HTML <th> scope 屬性

HTML th 標籤參考手冊 HTML <th> 標籤

實例

把兩個表頭單元格規定為列的表頭:

<table border="1">
  <tr>
    <th></th>
    <th scope="col">Month</th>
    <th scope="col">Savings</th>
  </tr>
  <tr>
    <td>1</td>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>2</td>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>


流覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

scope 屬性在普通的 Web 流覽器中沒有視覺效果,但可以通過螢幕閱讀器使用。


定義和用法

scope 屬性規定某個表頭單元格是否是列、行、列組或行組的表頭。


HTML 4.01 與 HTML5之間的差異

無。


語法

<th scope="col|row|colgroup|rowgroup">

屬性值

描述
col 規定單元格是列的表頭。
row 規定單元格是行的表頭。
colgroup 規定單元格是列組的表頭。
rowgroup 規定單元格是行組的表頭。


HTML th 標籤參考手冊 HTML <th> 標籤