一个右对齐的 HTML 表格:
</>code
- <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>
align 属性规定表格相对于周围元素的对齐方式。
通常来说,HTML 表格的前后都会出现折行。通过运用 align 属性,可实现其他 HTML 元素围绕表格的效果。
在 HTML 4.01 中,不赞成使用 body 元素的 align 属性;在 XHTML 1.0 Strict DTD 中,不支持 body 元素的 align 属性。
请使用 CSS 代替。
CSS 语法:<table style="float:right">
在我们的 CSS 教程中,您可以找到更多有关 float 属性的细节。
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号