在水平方向上,可以設定表頭的對齊方式,分別有居左、居中、居右3種。
基本語法
<th align="left">
<th align="center">
<th align="right">
語法解釋
left為居左,center為居中,right為居右。
文件范例:10-40.htm
設定表頭的水平對齊方式。
01 <!-- ------------------------------ -->
02 <!-- 文件范例:10-40.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 align="center">網頁圖像軟件</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行定義了表頭的水平對齊方式為居中。
新聞熱點
疑難解答