Setting Horizontal and Vertical Alignment

Setting Horizontal and Vertical Alignment

A cell’s content has two alignments: vertical (top, middle, or bottom) and horizontal (left, center, right, or justify).

To set alignment with attributes, use the align attribute to specify the horizontal alignment and the valign attribute to specify the vertical alignment.

Like :- <td align=”center” valign=”middle”>

You can also set alignment with a style by using text-align to specify the horizontal alignment and vertical-align to specify the vertical alignment.

Like :- <td style=”text-align: center; vertical-align: middle”>