HTML <col> Tag

Description

The <col> HTML element sets the width and other characteristics of one or more columns of a table. With this element, the browser starts showing the contents of the table, without waiting for it to fully load. <col> can be used in conjunction with the <colgroup> element, which defines a group of columns that share common characteristics.

Properties

Permitted Parents
<colgroup> only, though it can be implicitly defined as its start tag is not mandatory. The <colgroup> must not have a span attribute.
Content
None. It is an empty element.
Start/End Tags
Start tag: required, End tag: forbidden

Example

<table width="100%" border="1">
<col align="left"></col>
<col align="left"></col>
<col align="right"></col>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>

Attributes

Attribute Definition
name Marks an area of the page that a link jumps to.
span Specifies how many columns to span.
width Width of the column.
align Specifies the alignment of the content related to a col element.
valign Specifies the vertical alignment of the content related to a col element.
char Specifies the alignment of the content related to a col element to a character.
charoff Specifies the number of characters the content will be aligned from the character specified by the char attribute.

Global Attributes

The <col> tag also supports the Global Attributes in HTML5

Event Attributes

The <col> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
YesYes11YesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4YesYesYes