HTML的<thead>元素定义了一组定义表格的列头的行。
{{EmbedInteractiveExample("pages/tabbed/thead.html","tabbed-taller")}}
内容类别 | 无. |
---|---|
允许内容 | 零或多个{{ HTMLElement("tr") }}元素. |
标签省略 | 开头的标签是强制的. 如果{{ HTMLElement("thead") }} 元素后直接跟 {{ HTMLElement("tbody") }}或{{ HTMLElement("tfoot") }}元素,结尾的标签可以被省略。 |
Permitted parents | A {{ HTMLElement("table") }} element. The {{ HTMLElement("thead") }} must appear after any {{ HTMLElement("caption") }} or {{ HTMLElement("colgroup") }} element, even implicitly defined, but before any {{ HTMLElement("tbody") }}, {{ HTMLElement("tfoot") }} and {{ HTMLElement("tr") }} element. |
Permitted ARIA roles | Any |
DOM interface | {{domxref("HTMLTableSectionElement")}} |
This element includes the global attributes.
left
, aligning the content to the left of the cellcenter
, centering the content in the cellright
, aligning the content to the right of the celljustify
, inserting spaces into the textual content so that the content is justified in the cellchar
, aligning the textual content on a special character with a minimal offset, defined by the {{ htmlattrxref("char", "thead") }} and {{ htmlattrxref("charoff", "thead") }} attributes {{ unimplemented_inline("2212") }}.If this attribute is not set, the left
value is assumed.
left
, center
, right
or justify
values, use the CSS {{ cssxref("text-align") }} property on it.char
value, in CSS3, you can use the value of the {{ htmlattrxref("char", "thead") }} as the value of the {{ cssxref("text-align") }} property {{ unimplemented_inline() }}.black = "#000000" |
green = "#008000" |
||
silver = "#C0C0C0" |
lime = "#00FF00" |
||
gray = "#808080" |
olive = "#808000" |
||
white = "#FFFFFF" |
yellow = "#FFFF00" |
||
maroon = "#800000" |
navy = "#000080" |
||
red = "#FF0000" |
blue = "#0000FF" |
||
purple = "#800080" |
teal = "#008080" |
||
fuchsia = "#FF00FF" |
aqua = "#00FFFF" |
char
, this attribute is ignored.
baseline
, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom
.bottom
, which will put the text as close to the bottom of the cell as it is possible;middle
, which will center the text in the cell;top
, which will put the text as close to the top of the cell as it is possible.See {{ HTMLElement("table") }} for examples on <thead>
.
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG','tables.html#the-thead-element','thead element')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C','tabular-data.html#the-thead-element','thead element')}} | {{Spec2('HTML5 W3C')}} |
{{Compat("html.elements.thead")}}
<thead>
element:
{{HTMLRef}}