购物车
登陆 / 注册
微信扫码登陆

推荐手册

align 属性

align 属性
这个属性表明了caption相对于table应该如何排列
灭绝小师太 灭绝小师太 更新时间:2019-04-13 16:52:34

HTML <caption> align 属性

定义与用法

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>

运行实例 »

点击 "运行实例" 按钮查看在线实例

网站导航
标签地图
学习路径
视频教程
开发软件
旗下子站
php中文网
phpstudy
技术文章
文档工具
关于我们
企业合作
人才招聘
联系我们
讲师招募
QQ交流群
QQ官方交流群
微信公众号
微信公众号