1. Computing & Technology

Discuss in my forum

<col />

By , About.com Guide

<col /> Description:

The <col /> tag defines and controls the appearance of a column within a column group.

<col /> Web Browser Support:

<col /> Attributes:

<col /> End Tag:

None

<col /> Contents:

Nothing. <col /> is a singleton tag.

<col /> Valid Context:

The <col /> tag is valid within the following tags:
colgroup, table

<col /> Usage:

  • a table using columns and colgroups
    <table rules="cols" width="200">
     <colgroup>
     <col align="center"> <col valign="bottom">
     </colgroup>
     <tr><td>
     column one should be aligned to the center of this column.
     </td><td>
     and the second to the bottom.
     </td></tr>
     </table>
  • a 3-column table with two columns the same
    <table cellspacing="0" cellpadding="4" border="1" width="400" height="100">
     <col span="2" align="right" />
     <tr>
     <td>this column will be aligned to the right, but not the bottom</td>
     <td>and so will this column</td>
     <td>but this one won't</td>
     </tr>
     </table>

<col /> Special Notes:

  • The function of this tag is to provide more control over the look and feel of the individual columns in a table.
  • Use this tag judiciously, as it's not well supported even in the browsers that support it.

More <col /> Information:

More about the Tag
Related HTML Tags