YouTip LogoYouTip

Att Col Valign

HTML col valign Attribute | Rookie Tutorial

HTML <col> valign Attribute

Example

A table with columns having different vertical alignment:

<table border="1" style="height:200px">
  <col valign="top">
  <col valign="bottom">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>

Try it Β»

Browsers Support

Only Internet Explorer and Opera support the valign attribute. However, IE and Opera do not support the value "baseline".

Definition and Usage

HTML5 no longer supports the valign attribute of the <col> tag.

The align attribute specifies the vertical alignment of the content related to the <col> element.

Syntax

<col valign="top|middle|bottom|baseline">

Attribute Values

Value Description
top Align the content to the top.
middle Align the content to the center (default value).
bottom Align the content to the bottom.
baseline Align the content to the baseline.

The baseline is a hypothetical line. In a line of text, most letters are based on the baseline. The baseline value sets all table data in the row to share the same baseline. The effect of this value is often the same as the bottom value. However, if the font sizes of the text vary, the baseline value will perform better. See the following diagram:

valign-bottom

valign-baseline

Related Pages

← Att Col WidthAtt Col Align β†’