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

HTML Reference Manual

HTML Tag Reference

HTML: <tr> valign attribute

<tr> The usage of the valign attribute, the valign attribute specifies the vertical alignment of the content within table rows, online instances demonstrate how to use the <tr> valign attribute, browser compatibility, syntax definition, and detailed information about its attribute values, etc.

 HTML <tr> tag

Online Example

An HTML table with different vertical alignment rows:

<table style="width:100%" border="1">
   <tr valign="middle">
    <td>2018</td>
    <td>$15320.00</td>
  </tr>
   <tr valign="top">
    <td>2019</td>
    <td>$18320.00</td>
  </tr>
</table>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the valign attribute.

Definition and Usage

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

The valign attribute specifies the vertical alignment of the content within a table row.

Syntax

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

Attribute Value

ValueDescription
topAligns content to the top.
middleAligns content to the center (default value).
bottomAligns content to the bottom.
baselineAligns 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 <tr> tag