HTML col tag

<col> tag in HTML

The <col> tag is used to modify styles in columns.

This tag becomes useful when there's a need to assign a set of attributes to the specified columns.

In such case, the attributes can be declared directly into the <col> element and their effect will be automatically transferred to the columns it represents.

The <col> tag must be defined inside the <colgroup> tag.

span attribute in <col> tag

span attribute specify how many consecutive columns will be affected.

The column count goes from left to right.

Default value is 1.

Example - span attribute default value is 1

Try Yourself


Try Yourself

To see how the above example work in detail, Click Here