<colgroup> : Table Column Group element

Introduction

The ‘<colgroup>‘ element in HTML is used to group a set of ‘<col>‘ elements that collectively define the properties for columns within a table.

It provides a way to apply common styling or attributes to multiple columns, making the code more concise and maintainable. The ‘<colgroup>‘ element is often placed as a child of the ‘<table>‘ element.

Here is an example :

Output :

This usage of ‘<colgroup>‘ can make the HTML code cleaner and more organized, especially when dealing with large tables where column styling or attributes need to be applied consistently.

Leave a Comment