align
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>
备注
- 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 作为块元素向表格的左边、右边、顶部、底部进行对齐。
兼容性注释
CSS 语法:
<caption style="caption-side:bottom">
<caption style="text-align:left">
语法
<caption align="left|right|top|bottom">
属性值
值 | 描述 |
---|---|
left | 标题在表格的左边。 |
right | 标题在表格的右边。 |
top | 标题在表格的上边。 |
bottom | 标题在表格的下边。 |
浏览器兼容性
align |
---|