colgroup

Support

Specifies property defaults for a group of columns in a table.

The colgroup tag is used to specify column dependent attributes for a table. You can use the col element to override the attributes of the colgroup for a specific column.

This element must be placed within a table element.

Note that Firefox, Google Chrome, Safari and Opera have only partial support for this element.

Example

<table border="1px">
<colgroup style="background-color: #a0a0f0;">
<col style="background-color: #a0f0a0;" />
<col span="2" />
</colgroup>
<tbody>
<tr>
<td>Apple</td>
<td>$5</td>
<td>$10.7</td>
</tr>
<tr>
<td>Pear</td>
<td>$10.50</td>
<td>$8.20</td>
</tr>
<tr>
<td>Peach</td>
<td>$23.30</td>
<td>$19.45</td>
</tr>
</tbody>
</table>

Preview

Apple $5 $10.7
Pear $10.50 $8.20
Peach $23.30 $19.45