The HTML5 colgroup Tag
The HTML5 <colgroup> tag is necessary when it comes to specifying the set of one or more columns. The column/s should appear in a table that has to be formatted. The use of HTML5 <colgroup> tag is extensive because it avoids the need to format cells and columns one by one. It is essential in applying the same formatting and aesthetics for a particular set of columns.
There are certain limitations when the HTML5 <colgroup> tag is used. It is supposedly utilized along with a <table> element. It is placed after the <caption> element. If the <thread>, <tbody>, <tfoot> and <tr> elements are used, the HTML5 <colgroup> tag is placed before these.
If in case the column that will be formatted is a part of a <colgroup>, the <col> tag is utilized to specify the format of the column. The <col> tag is placed inside the <colgroup> tag.
The HTML5 <colgroup> tag is in perfect harmony with the Event Attributes and Global Attributes in HTML5. However, some of the attributes in HTML4.01 are no longer being used in HTML5. The attributes for the HTML5 <colgroup> tag are the following:
Attribute |
Value |
Description |
align |
left |
HTML5 does not support it. |
char |
character |
HTML5 does not support it. |
charoff |
number |
HTML5 does not support it. |
span |
number |
Defines the number of columns the <colgroup> should span |
valign |
top |
HTML5 does not support it. |
width |
% |
HTML5 does not support it. |