HTML 5 <tfoot> 標(biāo)簽
定義和用法
定義表格的頁腳(腳注)。
thead、tfoot 以及 tbody 元素使您有能力對表格中的行進(jìn)行分組。當(dāng)您創(chuàng)建某個表格時,您也許希望擁有一個標(biāo)題行,一些帶有數(shù)據(jù)的行,以及位于底部的一個總計行。這種劃分使瀏覽器有能力支持獨立于表格標(biāo)題和頁腳的表格正文滾動。當(dāng)長的表格被打印時,表格的表頭和頁腳可被打印在包含表格數(shù)據(jù)的每張頁面上。
HTML 4.01 與 HTML 5 之間的差異
在 HTML 5 中,不支持 <tfoot> 標(biāo)簽的任何屬性。
提示和注釋:
注釋:<tfoot> 內(nèi)部必須擁有 <tr> 標(biāo)簽!
注釋:如果您使用 thead、tfoot 以及 tbody 元素,您就必須使用全部的元素。它們的出現(xiàn)次序是:thead、tfoot、tbody,這樣瀏覽器就可以在收到所有數(shù)據(jù)前呈現(xiàn)頁腳了。您必須在 table 元素內(nèi)部使用這些標(biāo)簽。
例子
<table> <thead> <tr> <td>THEAD 中的文本</td> </tr> </thead><tfoot>
<tr> <td>TFOOT 中的文本</td> </tr></tfoot>
<tbody> <tr> <td>TBODY 中的文本</td> </tr> </tbody> </table>
屬性
標(biāo)準(zhǔn)屬性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title
如需完整的描述,請訪問 HTML 5 中標(biāo)準(zhǔn)屬性。
事件屬性
onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload
如需完整的描述,請訪問 HTML 5 中事件屬性。