HTML: <COL> vs. <COLGROUP> – What’s the difference between the table tags COL and COLGROUP?

As we all know, HTML tables have a way to distinguish between columns and groups of them to do things about them and that is the COL tag and the COLGROUP tag.

They pretty much have exactly the same set of available attributes – they are almost identical except for the names they are born with. Now what’s the difference between them really?

The only difference between COL tag and COLGROUP tag is the semantic nuances. While COL can surely span across multiple table columns, COLGROUP provide a more semantic meaning in the same task by grouping them with meanings – that is column groups with table columns related to each other in some nature.


By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Shoot me a message.

3 replies on “HTML: <COL> vs. <COLGROUP> – What’s the difference between the table tags COL and COLGROUP?”

I can’t understand the difference.
Please explain in detail.
Add some examples.

there’s a more practical difference between the two tags.
the ‘col’ tag can be used inside a ‘colgroup’ tag, so you can create sub-groups of column groups.
‘colgroup’ can have ‘col’ tags inside it (and only them, you can’t put ‘colgroup’ inside ‘colgroup’), unlike the ‘col’ tag that is always empty.

Comments are closed.