HTML <tr> align 屬性
實例
帶有居中對齊行的 HTML 表格:
<table width="100%" border="1">
<tr align="center">
<th>Month</th>
<th>Savings</th>
</tr>
<tr align="center">
<td>January</td>
<td>$100</td>
</tr>
</table>
<tr align="center">
<th>Month</th>
<th>Savings</th>
</tr>
<tr align="center">
<td>January</td>
<td>$100</td>
</tr>
</table>
流覽器支持
所有主流流覽器都支持 align 屬性。
注意:幾乎沒有流覽器能夠正確地處理 "char" 值。
定義和用法
HTML5 不支持 <tr> align 屬性。請使用 CSS 代替。
align 屬性規定表格行中的內容的水準對齊方式。
語法
<tr align="left|right|center|justify|char">
屬性值
值 | 描述 |
---|---|
left | 左對齊內容(<td> 元素的默認值)。 |
right | 右對齊內容。 |
center | 居中對齊內容(<th> 元素的默認值)。 |
justify | 對行進行伸展,這樣每行都可以有相等的寬度(就像在報紙和雜誌中)。 |
char | 將內容對準指定字元。 |
