colgroup tag

<Colgroup>

Explanation

Colgroup tag helps to combine the columns in a table.
"Colgroup" is the collection of entire table columns.
<table border="Value"> <colgroup span="value" style="background-color:Color Name"> <colgroup width="Value"></colgroup> <colgroup width="Value"></colgroup> </colgroup> <tr> <td>Name</td> <td>Value</td> </tr> </table>
Element Specific attributes supported by this tag are:
AttributeValueDescription
span number Defines how much time a <colgroup> should span in the column.

Example Code:

Result :
Column 1 Column 2 Column 3 Column 4 Column 5

  • It must be placed after <caption> and placed before <thead>, <tbody>, <tfoot> and <tr>.
  • It is enough to apply this tag at once, so it will insert styles to the entire columns of a table.
It is available in previous versions of HTML.
It supports both Global Attributes and Event Attributes in HTML5.

Limitations:

It will function in all the browsers.

Ask Questions

Ask Question