您的位置:寻梦网首页编程乐园HTML园地HTML实用教程
HTML实用教程
作者:佚名 来源:梦之都(www.dreamdu.com)

9.6. HTML scope 属性

scope 属性 -- 定义了行或列的表头
  • scope -- 通过此属性可以定义行或列的表头
  • 取值
    • col -- 定义列表头
    • row -- 定义行表头
    • colgroup -- 定义列组的表头信息,是column group的缩写
    • rowgroup -- 定义行组的表头信息,是row group的缩写

示例

<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视频教程