HTML 表格由三層標籤構成:
<table>:表格容器<tr>:列(Table Row)<td>:儲存格(Table Data)範例:3欄2列表格
<table border="1">
<tr>
<td>儲存格 1</td><td>儲存格 2</td><td>儲存格 3</td>
</tr>
<tr>
<td>儲存格 4</td><td>儲存格 5</td><td>儲存格 6</td>
</tr>
</table>
| 方向 | 屬性 | 說明 | 範例 |
|---|---|---|---|
| 左右合併(跨欄) | colspan | 橫跨 N 個欄位 | <td colspan="3"> |
| 上下合併(跨列) | rowspan | 縱跨 N 個列 | <td rowspan="2"> |
合併時,被合併的儲存格標籤需刪除,否則會導致結構錯位。
align="left|center|right" 加在 <td> 上valign="top|middle|bottom" 加在 <td> 上<table width="100" height="60"><table width="100" height="60" border="1">
<tr>
<td align="center" valign="top">內容置中靠上</td>
</tr>
</table>







