HTML <colgroup> Tag
Description
The <colgroup> element in HTML is used to group together one or more <col> elements within a table. This grouping allows developers to apply styling, such as width or background color, consistently to entire columns rather than applying styles individually to each cell. Essentially, <colgroup> serves as a structural and semantic wrapper for columns, making table markup cleaner and more manageable, especially for tables with many columns.
While <colgroup> itself does not display any content in the table, it plays a critical role in controlling the presentation of columns. By defining a <colgroup> at the beginning of a table, developers can set column-wide properties that cascade to all cells in the corresponding columns. This is particularly useful for setting uniform widths, applying background colors to specific columns, or enhancing accessibility by clarifying table structure for assistive technologies.
A <colgroup> can contain multiple <col> elements, each representing a single column, and it can also optionally define the number of columns it affects without using individual <col> tags. This flexibility makes it a powerful tool for organizing and styling complex tables while keeping the HTML concise and semantically meaningful.
Properties
Example
Attributes
- 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 information will show you the current browser support for the HTML <colgroup> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.
This tag is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 26th December 2025
