HTML <colgroup> Tag
<table>
<colgroup style="background:#F9D74E;"></colgroup>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
<th>Header 4</th>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
</tr>
</table>
The <colgroup>
element represents one or more columns within a <table>
element. It can be used to separate columns within a table into logical groups. This can be useful for applying styles across a single column or a group of columns.
To span multiple columns, use the span attribute.
You can also place <col>
elements inside the <colgroup>
element to specify one or more columns within the colgroup.