How to use col tag


<col>

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 <col> tag is supported in all major browsers.

What is col tag

Col tag means column. basically use for table columns you can change column property with col tag.

Leave a Reply

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