Description:

The <col> tag defines attribute values for one or more columns in a table.

The <col> tag is useful for applying styles to entire columns, instead of repeating the styles for each cell, for each row.

The <col> tag can only be used inside a table or a colgroup element.

Example Code:
<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>
Result:
ISBN Title Price
3476896 My first HTML $53
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



Last updated on 2 August 2018 By Rene Spronk

View All HTML Tags

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.