Definition and Usage The span attribute specifies the number of columns the colgroup element should span. This attribute should not be con...
Definition and Usage
The span attribute specifies the number of columns the colgroup element should span.
This attribute should not be confused with the colspan attribute. This attribute does not merge any cells.
Syntax
<colgroup span="columns" /> |
Syntax Example
Attribute Values
Value | Description |
columns | Specifies the number of columns the colgroup element covers. |
Browser Support
The attribute is supported in all major browsers.
Note: Even though this attribute has strong support in all browsers, most of the other colgroup attributes has poor support.
Example
Source | Output |
<table border="1">
<colgroup span="2" width="40px" />
<colgroup width="100px" />
<tr>
<th colspan="3">This table contains
three table data cells</th>
</tr>
<tr>
<td>Harry</td>
<td>Potter</td>
<td>Richard</td>
</tr>
</table> |
This table contains
three table data cells |
Harry | Potter | Richard |
|