Last Updated on April 26, 2023 by Roshan Parihar
HTML col tag is used to specify the background for table column content.
we can style the table columns using style attribute in HTML col tag. There is no closing tag for col element.
Syntax
1 |
<col style="specify CSS background property here..."> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<table border="1"> <caption>This is the table caption</caption> <colgroup> <col style="background-color:green"> <col style="background-color:yellow"> </colgroup> <tr> <th>Television Companies</th> <th>Description</th> </tr> <tr> <td>Onida</td> <td>Onida is the lowest selling company.</td> </tr> </table> |
Output
Television Companies | Description |
---|---|
Onida | Onida is the lowest selling company. |
Resources and References of HTML col tag
1. W3C Specification.
2. HTML living standard
3. W3C project using Github