<th> 定義表格表頭儲存格,預設**置中加粗**,語義上區別於資料儲存格 <td>,有助螢幕閱讀器與搜尋引擎理解表格結構。
<table border="1" width="80%" bgcolor="#e8e8e8" cellpadding="2"
bordercolor="#0000ff" bordercolorlight="#7d7dff" bordercolordark="#0000a0">
<tr>
<th width="30%" colspan="2" valign="bottom">大西洋賽區</th>
<th width="30%" colspan="2" valign="bottom">中部賽區</th>
<th width="30%" colspan="2" valign="bottom">東南賽區</th>
</tr>
<tr>
<td width="16%" align="center">鳶尾</td> ... </tr>
</table>
| 屬性 | 說明 |
|---|---|
align | 水平對齊:left/center/right |
valign | 垂直對齊:top/middle/bottom |
bgcolor | 背景色 |
background | 背景圖 |
bordercolor | 邊框色 |
bordercolorlight | 亮邊框色(IE) |
bordercolordark | 暗邊框色(IE) |
width | 寬度(像素/%) |
height | 高度(像素/%) |
colspan | 跨欄合併 |
rowspan | 跨列合併 |
<thead><tr><th>...</th></tr></thead> 明確語義分組。th { background:#f0f0f0; font-weight:bold; text-align:center; }。scope="col|row" 或 headers/id 強化無障礙關聯。