HTML scope 属性

scope 属性 -- 行或列的表头属性
  • scope -- 通过此属性可以定义行或列的表头
  • 取值
    • col -- 定义列表头
    • row -- 定义行表头
    • colgroup -- 定义列组的表头信息,是column group的缩写
    • rowgroup -- 定义行组的表头信息,是row group的缩写
  • 引用网址:http://www.dreamdu.com/xhtml/attribute_scope/

示例

<table width="80%">
        <tr>
                <th> </th>
                <th abbr="com domain" scope="col">.com域名的数量</th>
                <th abbr="cn domain" scope="col">.cn域名的数量</th>
                <th abbr="net domain" scope="col">.net域名的数量</th>
        </tr>
        <tr>
                <th abbr="2003s" scope="row">2003</th>
                <td>1000</td>
                <td>2000</td>
                <td>3000</td>
        </tr>
        <tr>
                <th abbr="2004s" scope="row">2004</th>
                <td>4000</td>
                <td>5000</td>
                <td>6000</td>
        </tr>
        <tr>
                <th abbr="2005s" scope="row">2005</th>
                <td>7000</td>
                <td>8000</td>
                <td>9000</td>
        </tr>
</table>

说明

  • scope属性通常可以连接表格数据单元格和表头.
  • 另一种连接表格数据单元格和表头的方法是使用headers属性,此属性通常只使用在表格比较复杂的情况下.


  • 教程中有什么不懂的地方?发现教程的错误!对教程有什么建议!快快给我留言呀 给猴子留言,我会尽快解答你的问题:)
  • HTML代码