HTML5 <col> Tag

The HTML <col> tag is used to define a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element. This element allows styling columns using CSS, but only a few attributes will have an effect on the column.

It is an empty element with a mandatory start tag. Since it is a void element, the use of an end tag is forbidden. Only <colgroup> can be the parent of the <col> element. Additionaly, the <colgroup> must not have a span attribute.

The following style is applied to this element by default:

col {
  display: table-column;
}

Attributes

span

This attribute contains a positive integer indicating the number of consecutive columns the <col> element spans. If not present, its default value is 1.

Further Reading

  1. Read more about the HTML <col> element on MDN.
  2. You can also read the HTML <col> tag reference on W3C.

Reader Comments

1. You can register or login to post a comment. Asking readers to register improves the quality of discussion.

2. As a registered user, you will also get to access features like choosing between a light and dark theme or anything else that we might implement in future.

Follow Us For Updates

FacebookTwitterGoogle+
Go To Top