align
HTML <table> align 属性
一个右对齐的 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>
定义和用法
HTML5 不支持 <table>
align 属性。请使用 CSS 代替。
在 HTML 4.01 中,<table>
的 align 属性已废弃。
提示
已废弃的元素或者属性意味着它已经过时。
废弃的元素在以后将会过时,但是浏览器会继续支持已废弃的元素。
已过时的元素和属性浏览器不再支持,W3C也不会再去定义它。
align 属性规定表格相对于周围文本的对齐方式。
通常来说,HTML 表格的前后都会出现折行。通过运用 align 属性,可实现其他 HTML 元素围绕表格的效果。
兼容性注释
在 HTML 4.01 中,<table>
的 align 属性已废弃,请使用 CSS 代替。
CSS 语法:<table style="float:right">
语法
<table align="left|right|center">
属性值
值 | 描述 |
---|---|
left | 左对齐表格。 |
right | 右对齐表格。 |
center | 居中对齐表格。 |
浏览器兼容性
align |
---|