HTML <colgroup> tag
When writing in HTML, the <colgroup> tag is used to denote a group of columns within a table. It is useful when you want to format many columns at the same time. The following sections contain information about this tag, including an example of it in use, as well as related attributes and browser compatibility.
Example of <colgroup> code
<table class="mtable2 tab">
<col span="1" style="background-color:#c1c1c3">
As the HTML code indicates, the entire table has a background color of white and the first column is "painted" grey. The table itself has one of our CSS classes applied to it to improve its appearance.
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the deprecated unique HTML attributes for the <colgroup> tag, as well as a description of each. While these attributes may work with the some versions of HTML, they will eventually be phased out. You should use CSS to adjust the dimensions of this element.
|align||Designates the alignment of content inside an attribute.|
|char||Designates the character within a column group to align with the rest of the content.|
|charoff||Designates the number of characters to offset the column group's content by relative to the char attribute.|
|span||Designates the number of columns the <colgroup> element should cover.|
|valign||Designates the vertical alignment of content with the <colgroup> element.|
|width||Designates how wide the <colgroup> element should be.|
|All versions||All versions||All versions||All version||All versions||All versions|