Latest web development tutorials

HTML td align property

HTML td tag Reference Manual HTML <td> tag

Examples

Right Align cell contents:

<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"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support align attribute.

Note: Almost no browser can handle "char" value correctly.


Definition and Usage

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

align attribute specifies the cell contents of the horizontal alignment.


grammar

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

Property Value

描述
left 左对齐内容(<td> 的默认值)。
right 右对齐内容。
center 居中对齐内容。
justify 对行进行伸展,这样每行都可以有相等的宽度(就像在报纸和杂志中)。
char 将内容对准指定字符。


HTML td tag Reference Manual HTML <td> tag