HTML <col> tag
The <col> tag is used for specifying column
properties for each column within a group of columns. You can use this tag if
the values of each column is different. Otherwise, you can specify the
properties to the group of columns with colgroup tag.
Example
<!DOCTYPE
HTML>
<html>
<body>
<table
border="2">
<caption><b>Students
Detail</b></caption>
<tr>
<th>Student
Id</th>
<th>Student
Name</th>
<th>Total
Marks(100)</th>
</tr>
<colgroup
span="1"
style="background-color:LightPink">
<tr>
<td>101</td>
<td>Ravi
Kumar</td>
<td>55</td>
</tr>
<colgroup
span="1"
style="background-color:LightYellow">
<tr>
<td>102</td>
<td>Meenakshi
Sharma</td>
<td>64</td>
</tr>
<colgroup
span="1"
style="background-color:LightBlue">
<tr>
<td>103</td>
<td>Vivek
Singh</td>
<td>76</td
</tr>
<tr>
<td>104</td>
<td>Divya
Gupta</td>
<td>85</td>
</tr>
</table>
</body>
</html>
Output

Now if you want to specify properties to the
group of columns use the <colgroup> tag to group columns in a table for
formatting. The <colgroup> tag is used for applying styles to entire columns, in
place of repeating the styles for each cell, for each row.
The <colgroup> tag
<!DOCTYPE
HTML>
<html>
<body
bgcolor='<!DOCTYPE
HTML>
<html>
<body>
<table
border="2">
<caption><b>Class
Detail</b></caption>
<colgroup
span="1"
style="background-color:#ccffcc">
<tr>
<th>Class</th>
<th>Hindi
Teacher</th>
<th>English
Teacher</th>
<th>Maths
Teacher</th>
</tr>
<colgroup
span="1"
style="background-color:#ffffcc">
<tr>
<td>2nd
</td>
<td>Kavita
Mathur</td>
<td>Kavita
Mathur</td>
<td>Madhu
Gupta</td>
</tr>
<colgroup
span="1"
style="background-color:#ffffcc">
<tr>
<td>3rd
</td>
<td>Kavita
Mathur</td>
<td>Kavita
Mathur</td>
<td>Ritu
Kumar</td>
</tr>
<colgroup
span="1"
style="background-color:#ffccff">
<tr>
<td>4th</td>
<td>Kavita
Mathur</td>
<td>Kavita
Mathur</td>
<td>Asha
Verma</td>
</tr>
</table>
</body>
</html>
Output

Note:
Use the <col> tag to specify different
attribute values to more than one table column and <colgroup> to specify the
same attribute values to a group of columns.