- 0133技术站
- 联系QQ:88526
- QQ交流群

- 微信公众号

align 属性在 HTML4.01 和 HTML5中都已废弃
这个属性表明了caption相对于table应该如何排列。它可能有以下几个值:
left:展示在表格左边
top:显示在表格前面
right:显示在表格右边
bottom:显示在表格下面
所有主流浏览器都支持 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" 值。
<caption align="left|right|top|bottom">
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <p>align="left":</p> <table border="1"> <caption align="left">My savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> <p>align="right":</p> <table border="1"> <caption align="right">My savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> <p>align="top":</p> <table border="1"> <caption align="top">My savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> <p>align="bottom":</p> <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> </body> </html>
点击 "运行实例" 按钮查看在线实例
推荐手册