colgroup Tag in HTML 5
The <colgroup> tag specifies a group of one or more columns in a table for formatting.
Example
<!Doctype Html>
<html>
<head>
<title>Colgroup Tag</title>
</head>
<body>
<table width="200" height="200" border="1">
<colgroup>
<col style="background-color:green">
<col style="background-color:red">
</colgroup>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Ram</td>
<td>22</td>
</tr>
<tr>
<td>Shyam</td>
<td>24</td>
</tr>
</table>
</body>
</html>
Output
Post Your Comment