How to use colgroup tag


<colgroup>

All Tags not showing in online page, but show on view source.

<table>
  <colgroup>
    <col style="background:yellow">
    <col style="background:green">
  </colgroup>
  <tr>
    <th>Roll no</th>
    <th>Name</th>
  </tr>
  <tr>
    <td>11</td>
    <td>Raj</td>
  </tr>
  <tr>
    <td<12</td>
    <td>Ravi</td>
  </tr>
</table>

Code show like this:

Roll no Name
11 Raj
12 Ravi

Browser Support

The <colgroup> tag is supported in all major browsers.

What is colgroup tag

Colgroup tag is column group. basically use for col group.

Leave a Reply

Your email address will not be published. Required fields are marked *