HTML <th> valignProperty

HTML <th> Tag

Example

HTML table with differently vertically aligned header cells:

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

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the valign attribute.


Definition and Usage

HTML5 does not support the <th> valign attribute. Use CSS instead.

The valign attribute specifies the vertical alignment of the content in header cells.


Syntax

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

Property value

Value Description
top Align the content to the top.
middle Aligns the content in the middle (default value).
bottom Align the content to the bottom.
baseline Aligns with the baseline. The 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 the row to share the same baseline. This value often has the same effect as the bottom value. However, if the font sizes of the text differ, the baseline effect will be better. See the illustration below.

When the text font size differs, bottom vs. baseline diagram:

valign="bottom"

valign="baseline"


HTML <th> Tagother extensions