HTML <td> alignAttributes

HTML td 标签参考手册HTML <td> Tag

Examples

Right-align the content in the cell:

<table width="100%" border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td align="right">$100</td>
</tr>
</table>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.

Note:Very few browsers can correctly handle the "char" value.


Definition and Usage

HTML5 does not support the <td> align attribute. Please use CSS instead.

The align attribute specifies the horizontal alignment of the content in the cell.


Syntax

<td align="left|right|center|justify|char">

Attribute Values

Value Description
left Left-aligns the content (default value for <td>).
right Right-aligns the content.
center Center-aligns the content.
justify Stretches the row so that each line can have equal width (like in newspapers and magazines).
char Aligns the content to a specified character.


HTML td 标签参考手册HTML <td> Tag Other Extensions