English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML td valign attribute

The valign attribute specifies the vertical alignment of the content within a cell, an online instance demonstrates how to use the HTML td valign attribute, browser compatibility, syntax definition, and detailed information about its attribute values, etc.

 HTML <td> tag

Online Example

Vertically align content within the <td> element:

<table style="width:100%" border="1" height="400">
  <tr>
    <th>Number</th>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td valign="top">1</td>
    <td valign="top">January</td>
    <td valign="top">3100</td>
  </tr>
  <tr>
    <td valign="bottom">2</td>
    <td valign="bottom">February</td>
    <td valign="bottom">2180</td>
  </tr>
</table>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the valign attribute.

Definition and Usage

HTML5 The <td> valign attribute is not supported. Please use CSS instead.

The valign attribute specifies the vertical alignment of the content within the cell.

Syntax

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

Attribute Value

ValueDescription
topAlign content upward.
middleAlign content to the center (default value).
bottomAlign content downward.
baselineAlign content to the baseline. The baseline is a fictional line. In a line of text, most letters are based on the baseline. The baseline value sets all table data in a line to share the same baseline. The effect of this value is often the same as the bottom value. However, if the text sizes are different, the baseline effect is better. Please see the illustration below.

Illustration of bottom vs. baseline when text sizes are different:

valign="bottom"

valign="baseline"

 HTML <td> tag