HTML <td> valignAttributes
Examples
An HTML table with cells that have different vertical alignment:
<table border="1"
style="height:200px">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td valign="top">January</td>
<td valign="top">$100</td>
</tr>
<tr>
<td valign="bottom">February</td>
<td valign="bottom">$80</td>
</tr>
</table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td valign="top">January</td>
<td valign="top">$100</td>
</tr>
<tr>
<td valign="bottom">February</td>
<td valign="bottom">$80</td>
</tr>
</table>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the valign attribute.
Definition and Usage
HTML5 does not support the <td> valign attribute. Use CSS instead.
The valign attribute specifies the vertical alignment of the content within a cell.
Syntax
<td valign="top|middle|bottom|baseline">
Attribute Values
| Value | Description |
|---|---|
| top | Aligns the content to the top. |
| middle | Aligns the content to the middle (default value). |
| bottom | Aligns the content to the bottom. |
| baseline | Aligns the content to the baseline. The baseline is an imaginary line. In a line of text, most letters are aligned based on the baseline. The baseline value sets all table data in the row to share the same baseline. The effect of this value is often the same as the bottom value. However, if the font sizes of the text vary, the baseline effect will be better. See the illustration below. |
Illustration of bottom vs. baseline when the text font sizes differ:
valign="bottom"
valign="baseline"
HTML <td> Tag Other Extensions