当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <thead>标签

HTML
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML 属性
HTML 事件
HTML URL-encode
HTML Web服务器
HTML 摘要
HTML 实例
标签列表
标准属性
事件属性
ASCII码
特殊字符
HTTP状态消息

HTML <thead>标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 352 ::
收藏到网摘: n/a

定义与用法

Defines a table header.
定义表格的标题

The thead, tfoot and tbody elements enable you to group rows in a table. When you create a table, you might want to have a header row, some rows with data, and a row with totals at bottom. This division enables browsers to support scrolling of table bodies independently of the table header and footer. When long tables are printed, the table header and footer information may be repeated on each page that contains table data.
在table中thead,tfoot以及tbody可以让你聚集表格中的多个行。当你建立一个表格的时候你或许希望有一个标题行,一些行来放置数据,最 下的一行来放总计。这样的划分在浏览器中可以使用滚轮从头到尾直接浏览,当打印的时候每有超出部分那么页眉和脚标会重新加到表格上(保证打印出来的每页都 有页眉和脚标)


在HTML和XHTML中的区别

NONE


提示与注意点

Note: The <thead> must have a <tr> tag inside!
注意<thead>必须放在<tr>标签的里面!

Note: If you use the thead, tfoot and tbody elements, you must use every element. They should appear in this order: <thead>, <tfoot> and <tbody>, so that browsers can render the foot before receiving all the data. You must use these tags within the table element.
注意:当你使用了thead, tfoot 和 tbody元素,那么你就必须使用它们每一个元素,它们出现的次序也应该是这样:<thead>, <tfoot> 和 <tbody>,只有这样浏览器才能在接收所有数据前先得到脚标的信息。还有一点你必须在table元素内使用它们

Note: The <thead>,<tbody> and <tfoot> elements are seldom used, because of bad browser support. Expect this to change in future versions of XHTML. If you have Internet Explorer 5.0 or newer, you can view an example in our XML tutorial.
注意:<thead>,<tbody> 和 <tfoot>并不常用,因为它们的浏览器支持性不好。不过预计会在XHTML中得到改善。如果你有IE以上版本的浏览器,那么你可以看看我们XML教程中的一个举例


实例

代码 输出结果
<table border = "1">
<thead>
<tr>
<td>This text is in the THEAD</td>
</tr>
</thead>
<tfoot>
<tr>
<td>This text is in the TFOOT</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>This text is in the TBODY</td> 
</tr>
</tbody>
</table>
This text is in the THEAD
This text is in the TFOOT
This text is in the TBODY


可选属性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)

属性 描述 DTD
align right
left
center
justify
char
Defines the text alignment in cells
定义单元格内的文字对齐
STF
char character Specifies which character to align text on.
指定向哪个字符看齐

Note: Only used if align="char"!
注意:只能当align="char"的时候才能使用

STF
charoff pixels
%
Specifies the alignment offset to the first character to align on.
取消向第一个字符对齐

Note: Only used if align="char"!
注意:只能当align="char"的时候才能使用

STF
valign top
middle
bottom
baseline
Specifies the vertical text alignment in cells
指定文字在单元内的垂直对齐
STF

标准属性

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
查看完整的属性

事件属性

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.
查看完整的属性

评论 (0) All

登陆 | 还没注册?