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