HTML <colgroup> tag

HTML <colgroup> tag : Definition

• The HTML <colgroup> tag represents a group of columns in a table, so that you can apply formatting or add classes to the group instead of each individual cell..

<colgroup> tag example :

<!DOCTYPE html>
table, th, td {
  border: 1px solid black;

<h1>The col element example</h1>

    <col span="2" style="background-color:red">
    <col style="background-color:yellow">
    <th>ZIP Code</th>



ZIP Code Name Address
815603 Rahul Ranchi
560029 Prayag Bangalore