Home → References → HTML Tags →
HTML Tag: colgroup
Column group. Specifies attributes to be applied to a set of table columns. Often used with col elements.
HTML Dog is hosted by Titan Internet
Required Attributes
- None.
Optional Attributes
spancan be used to specify the number of columns the colgroup element applies to.aligncan be used to horizontally align the cells within the column group. The value can beleft,center,right,justifyorchar.valigncan be used to vertically align the cells within the column group. The value can betop,middle,bottomorbaseline.charcan be used to specify a character with which cells will align, such as a decimal point. It is not supported by any major browser.charoffcan be used to specify the number of pixels the alignment should be offset from thecharcharacter. It is not supported by any major browser.- Common attributes
Example
<table>
<colgroup span="2" class="columns1and2"></colgroup>
<tr>
<th>lime</th>
<th>lemon</th>
<th>orange</th>
<th>blood orange</th>
</tr>
<tr>
<td>8</td>
<td>7</td>
<td>12</td>
<td>5</td>
</tr>
...
</table>

