首页 > 开发 > HTML > 正文

HTML表格标记教程(17):表格标题垂直对齐属性VALIGN

2020-09-18 22:18:50
字体:
来源:转载
供稿:网友

表格的标题可以放在表格的上方或者下方,这可以通过属性进行调整。默认的表格标题放在表格上方。

基本语法

     <caption valign="top">…</caption>

     <caption valign="bottom“> …</caption>

语法解释

top为居上,bottom为居底。

文件范例:10-16.htm

通过<caption>标记的valign属性设定表格标题的垂直对齐。
01  <!-- ------------------------------ -->
02  <!-- 文件范例:10-16.htm -->
03  <!--文件说明:设定表格标题的垂直对齐-->
04  <!-- ------------------------------ -->
05  <html>
06  <head>
07  <title>设定表格标题的垂直对齐</title>
08  </head>
09  <body>
10  <table border=3 width=400 height=100 bordercolor=#336699 align="center">
11  <caption valign="bottom" align="right">主流的网页设计软件</caption>
12  <tr>
13  <td>网页图像软件</td><td>fireworks</td>
14  </tr>
15  <tr>
16  <td>网页制作软件</td><td>dreamweaver</td>
17  </tr>
18  <tr>
19  <td>网页动画软件</td><td>flash</td>
20  </tr>
21  </table>
22  </body>
23  </html>

文件说明

第11行定义了表格标题文字居底部右对齐。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表