HTML <col> valignAttribute

HTML col 标签参考手册HTML <col> tag

Examples

A table with columns that have different vertical alignments:

<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 Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 <col> valign attribute.

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 Top-aligns the content.
middle Center-aligns the content (default value).
bottom Bottom-aligns the content.
baseline Aligns with the baseline.

A baseline is an imaginary line. In a line of text, most letters are positioned relative to the baseline. The baseline value sets all table data in a row to share the same baseline. The effect of this value is often the same as the bottom value. However, if the text font sizes differ, the baseline effect will be better. See the illustration below:

valign="bottom"

valign="baseline"


HTML col 标签参考手册HTML <col> tag Other Extensions