Colgroup in HTML Table - How to make columns group in Tables in HTML


<Colgroup> in HTML Table - How to make columns group in Tables in HTML

The <colgroup> Tag is used to make the columns group in HTML Tables. Basically it is used to combined 2 or more columns in a group and specify the same layout like color, bgcolor etc for the column group.
The span property of a <colgroup> specify the how much columns you want to combined.

Example:-

<table>
<colgroup span="2" bgcolor="green"></caption>
<tr>
<th>Roll No.</th>
<th>Name</th>
<th>Course</th>
<th>Address</th>
</tr>
<tr>
<td>1001</td>
<td>Talib</td>
<td>MCA</td>
<td>Undefined</td>
</tr>
</table>

{ 0 comments... read them below or add one }

Post a Comment