HTML <colgroup> Tag


The <colgroup> HTML element is intended to specify the width and style of one or more columns of the table. This element allows you to reduce the code of the table by reducing duplicate attributes, and if it is available, the browser starts showing the contents of the table, without waiting for it to fully load. The <colgroup> element can be used in combination with <col> , which defines the characteristics of one or more columns.
Usually, a closing tag is not required, but if the <colgroup> acts as a container for the <col> elements, then the </colgroup> tag should be added at the end of the group.


Permitted Parents
A <table> element. The <colgroup> must appear after any optional <caption> element but before any <thead>, <th>, <tbody>, <tfoot> and <tr> element.
0 or more <col> elements
Start/End Tags
Start tag: required, End tag: required


<table border="1">
<colgroup span="2" style="background-color: #DFF0D8;"></colgroup>
<col span="1" style="background-color: lightblue;">
<th>Population (in millions)</th>
<td>Washington D.C.</td>


Attribute Definition
span Specifies how many columns to span.

Global Attributes

The <colgroup> tag also supports the Global Attributes in HTML5

Event Attributes

The <colgroup> tag also supports the Event Attributes in HTML5

Browser Support

The following table will show you the current browser support for the HTML <colgroup> tag.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th March 2024