Latest

recent

HTML colgroup span Attribute

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

<colgroup span="3" />

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
HTML colgroup span Attribute Reviewed by 1000sourcecodes on 05:44 Rating: 5
Powered by Blogger.