HTML slt;tr?valign property
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:
<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
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
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:
valign="bottom"
valign="baseline"
HTML and tr;tags
Related articles
HTML DOM Reference Manual: HTML DOM tr vAlign property