HTML slt;tr?valign property

HTML tr valign attribute HTML and tr;tags

The valign property defines which vertical alignment the rows in the table should be, for example, in the following example, we align the first row in the table vertically, and the second line achieves vertical down alignment:

HTML tables with different vertical alignment rows:

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

Try it out . . .

Browser support

HTML tr valign attribute HTML tr valign attribute HTML tr valign attribute HTML tr valign attribute HTML tr valign attribute

The valign property is supported by all major browsers.


Definitions and usages

HTML5 does not support the slt;tr?valign property. Use CSS instead.

The valign property specifies the vertical alignment of the contents of a table row.


Grammar

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

The property value

value describe
top Content is aligned.
middle The content is aligned (default).
bottom During the content is aligned.
baseline Align with baseline.The baseline is a fictional line.In a line of text, most letters are based on baseline.Baseline Value Set All Table Data in the Row share the same baseline.The effect of this value is often the same as the Bottom value.However, if the font size of the text is different, then the effect of Baseline will be better.Please see the illustration below.

When the size of the text is different, the bottom vs. baseline illustration:

HTML tr valign attribute valign="bottom"

HTML tr valign attribute valign="baseline"


HTML tr valign attribute HTML and tr;tags

Related articles

HTML DOM Reference Manual: HTML DOM tr vAlign property