HTML表格标记教程(43):表头的垂直对齐属性VALIGN


在垂直方向上,可以设定表头的对齐方式,分别有居上、居中、居下3种。

基本语法

<th valign="Top">
<th valign="Middle">
<th valign="Bottom">

语法解释

Top为居上,Middle为居中,Bottom为居下。

文件范例:10-41.htm

设定表头的垂直对齐方式。
01 <!-- ------------------------------ -->
02 <!-- 文件范例:10-41.htm -->
03 <!-- 文件说明:设定表头垂直对齐 -->
04 <!-- ------------------------------ -->
05 <html>
06 <head>
07 <title>设定表头垂直对齐</title>
08 </head>
09 <body>
10 <h1>主流的网页设计软件</h1>
11 <table border=3 width=400 height=100 bordercolor=#336699 background=10-8.JPG
cellspacing=10 cellpadding=25>
12 <tr>
13 <th valign="Top">网页图像软件</th><th>Fireworks</th>
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>

文件说明

第13行定义了表头的垂直对齐方式为居上。


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3