HTML 5 <th> scope 屬性
實(shí)例
規(guī)定兩個(gè)表頭單元格是兩個(gè)列的頭部:
<table> <tr> <th></th> <thscope="col"
>月份</th> <thscope="col"
>存款</th> </tr> <tr> <td>1</td> <td>一月</td> <td>3000 元</td> </tr> <tr> <td>2</td> <td>二月</td> <td>5000 元</td> </tr> </table>
瀏覽器支持
scope 屬性在普通的 web 瀏覽器中沒有可見效果,但可被屏幕閱讀器使用。
定義和用法
scope 屬性規(guī)定此表頭單元格是否是行、列、行組或列組的頭部。
HTML 4.01 與 HTML 5 之間的差異
無差別。
語(yǔ)法
<th scope="col|row|colgroup|rowgroup">
屬性值
值 | 描述 |
---|---|
col | 規(guī)定表頭單元格是列的表頭。 |
row | 規(guī)定表頭單元格是行的表頭。 |
colgroup | 規(guī)定表頭單元格是列組的表頭。 |
rowgroup | 規(guī)定表頭單元格是行組的表頭。 |