Open In App
Related Articles

HTML <colgroup> Tag

Improve Article
Save Article
Like Article

 This tag is used to specify the group of one or more columns in a table for formatting. It is useful for applying styles to entire columns, instead of repeating the styles for each column, and for each row. Use the <col> tag within the <colgroup> tag to define different properties to a column within a <colgroup>. Most of the attributes in HTML 4.01 <colgroup> are not supported in HTML5.


<colgroup> Column lists... </colgroup>


  • align: It is used to align the text or content in the group of columns. The value of the aligned property is left, right, center, justify, char.
  • char: It is used to align the character in a column group and the value of these attributes is the character.
  • charoff: It is used to sets the number of characters that will be aligned from the character specified by the char attribute. The value of these attributes is in numeric form.
  • span: It is used to specify the number of columns that have colgroup tag. The values are in numeric form.
  • valign: It specifies the vertical alignment of content in a colgroup. It’s values are the top, middle, bottom, baseline.
  • width: It defines the width of a column group. It’s values are pixels, %, relative_length.

Example: The below example explains the HTML colgroup tag.


<!DOCTYPE html>
    <h2>HTML colgroup tag</h2>
      <!-- colgroup tag starts here-->
        <col span="2" style="background-color: green; color: white" />
        <col style="background-color: tomato" />
            <!-- colgroup tag ends here--> 
        <td>Manas Chhabra</td>
        <td>Anurag Gupta</td>


Supported Browsers: 

  • Google Chrome 1
  • Edge 12
  • Internet Explorer
  • Firefox 1
  • Opera
  • Safari


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 21 Jul, 2022
Like Article
Save Article
Similar Reads
Complete Tutorials