By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

HTML Col Tag

Reference on the Col Element of HTML. Including its useful example, and a list of allowed attributes.

Edited: 2014-12-28 07:11

The col element, is used inside the table elements, to apply attributes to whole columns.

This element should be placed inside a table or colgroup element.


AttrsOther AttributesCommon, Event, I18n
widthLength UnitSets the width of the column'(s).
spanNUMBERNumber of columns to effect.
cellhalignleft|center|right|justify|charhorizontal alignment in cells
cellvaligntop|middle|bottom|baselinevertical alignment in cells

The Span Attribute

This attribute controls how many columns to span, the default value is 1.


<table style="width:100%;border:1px solid black;">
  <col style="background: silver;"> <!--Col 1-->
  <col style="background: gray;"> <!--Col 2-->
  <col style="background: green;"> <!--Col 3-->
    <td>Col 1</td>
    <td>Col 2</td>
    <td>Col 3</td>
    <td>HTML table</td>
    <td>col element</td>
    <td>HTML col</td>
    <td>Grouped attributes</td>

Brugbart Vision!