HTML <tfoot> 標籤的 align 屬性

實例

下面的 HTML 表格將 tfoot 元素中的內容居中對齊:

<table border="1" width="100%">
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  <tfoot align="center">
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>  
</table>

定義和用法

align 屬性規定 tfoot 元素中的內容的水平對齊方式。

瀏覽器支援

所有瀏覽器都支援 align 屬性。

註釋:IE 無法正確地處理 "justify" 值,IE 會以居中的方式進行處理。

註釋:幾乎沒有瀏覽器能夠正確地處理 "char" 值。

語法

<tfoot align="value">

屬性值

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