<colgroup> HTML Tag

Element of
What does <colgroup> HTML Tag do?
The <colgroup> element is used a parent container for one or more <col> elements which are used to target columns in an HTML table.

Code Example

.total {
 background-color: #eeeeee;
 <col span="3">
 <col class="total">
<td colspan="3">TOTAL</td>
Item Qty. Price Cost
Bananas 5 0.50 2.50
Apples 2 0.25 0.50
Oranges 3 0.75 2.25
TOTAL 5.25

Using <col> and <colgroup>

The <colgroup> element serves only as a container for one or more <col> elements, which define columns within a <table>. For more information about table columns, including common problems and solutions for styling them, see the <col> element documentation

Adam is a technical writer who specializes in developer documentation and tutorials.

Browser Support for colgroup