HTML caption align 屬性
實例
帶有與底部對齊的<caption> 元素的表格:
<table border="1">
<caption align="bottom">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<caption align="bottom">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
嘗試一下»
瀏覽器支持
所有主流瀏覽器都支持align 屬性。
注意:
- Internet Explorer 8 支持"left", "right", "top", 和"bottom" 值。
- Internet Explorer 9+ 支持"top", 和"bottom" 值。
- Firefox 支持"left", "right", "top", 和"bottom" 值。
- Opera 支持"left", "right", "top", 和"bottom" 值。
- Chrome 支持"top", 和"bottom" 值。
- Safari 支持"top", 和"bottom" 值。
定義和用法
HTML5不支持<caption> align屬性。 請使用CSS替代。
<caption> 的align 屬性在HTML 4.01 中已廢棄。
align 屬性規定caption 元素的對齊方式。
該屬性將caption 作為塊元素向表格的左邊、右邊、頂部、底部進行對齊。
兼容性註釋
THTML5 不支持<caption> align 屬性。 請使用CSS 替代。
CSS 語法: <caption style="caption-side:bottom"> or <caption style="text-align:left">
在我們的CSS教程中,您可以找到更多有關caption-side屬性的細節。
語法
<caption align="left|right|top|bottom">
屬性值
值 | 描述 |
---|---|
left | 標題在表格的左邊。 |
right | 標題在表格的右邊。 |
top | 標題在表格的上邊。 |
bottom | 標題在表格的下邊。 |