HTML <th> align 屬性

HTML th 標籤參考手冊 HTML <th> 標籤

實例

向左對齊表頭單元格中的內容:

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


流覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流流覽器都支持 align 屬性。

注意:幾乎沒有流覽器能夠正確地處理 "char" 值。


定義和用法

HTML5 不支持 <th> align 屬性。請使用 CSS 代替。

align 屬性規定表頭單元格中內容的水準對齊方式。


語法

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

屬性值

描述
left 左對齊內容。
right 右對齊內容。
center 居中對齊內容(<th> 的默認值)。
justify 對行進行伸展,這樣每行都可以有相等的寬度(就像在報紙和雜誌中)。
char 將內容對準指定字元。


HTML th 標籤參考手冊 HTML <th> 標籤