HTML <tr> 標(biāo)簽的 align 屬性
定義和用法
align 屬性規(guī)定表格行中內(nèi)容的水平對(duì)齊方式。
實(shí)例
帶有居中對(duì)齊行的表格:
<table width="100%" border="1"> <tralign="center"
> <th>Month</th> <th>Savings</th> </tr> <tralign="center"
> <td>January</td> <td>$100</td> </tr> </table>
瀏覽器支持
所有瀏覽器都支持 align 屬性。
注釋:IE 無(wú)法正確地處理 "justify" 值,IE 會(huì)以居中的方式進(jìn)行處理。
注釋:幾乎沒有瀏覽器能夠正確地處理 "char" 值。
語(yǔ)法
<tr align="value">
屬性值
值 | 描述 |
---|---|
left | 左對(duì)齊內(nèi)容(默認(rèn)值)。 |
right | 右對(duì)齊內(nèi)容。 |
center | 居中對(duì)齊內(nèi)容(th 元素的默認(rèn)值)。 |
justify | 對(duì)行進(jìn)行伸展,這樣每行都可以有相等的長(zhǎng)度(就像在報(bào)紙和雜志中)。 |
char | 將內(nèi)容對(duì)準(zhǔn)指定字符。 |