HTML <table> align 屬性

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

實例

一個右對齊的 HTML 表格:

<table border="1" align="right">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>


流覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


定義和用法

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

在 HTML 4.01 中,<table> 的 align 屬性 已廢棄

align 屬性規定表格相對於周圍文本的對齊方式。

通常來說,HTML 表格的前後都會出現折行。通過運用 align 屬性,可實現其他 HTML 元素圍繞表格的效果。


相容性注釋

在 HTML 4.01 中,<table> 的 align 屬性已廢棄,請使用 CSS 代替。

CSS 語法:<table style="float:right">

在我們的 CSS 教學中,您可以找到更多有關 float 屬性 的細節。


語法

<table align="left|right|center">

屬性值

描述
left 左對齊表格。
right 右對齊表格。
center 居中對齊表格。


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