9.6. 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属性,此属性通常只使用在表格比较复杂的情况下.


  • 在梦之都注册域名,1元
  • 发现教程中的错误或别扭,快快通知我呀,报告错误,我会非常感谢你对一个公益网站做出的建议与贡献:)
  • 技术群: 42215270