Last Updated on April 26, 2023 by Roshan Parihar
HTML colgroup tag is used to specify table background styles.
The colgroup tag defines the column background of table with HTML col tag.
Syntax
1 |
<colgroup>Put colgroup element here...</colgroup> |
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>Company Name</th> <th>Description</th> </tr> <tr> <td>Infosys</td> <td>Infosys is a software company</td> </tr> </table> |
Output
Company Name | Description |
---|---|
Infosys | Infosys is a software company |
Resources and References of HTML colgroup tag
1. W3C Specification.
2. HTML living standard
3. W3C project using Github