English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das HTML-Element <thead> definiert eine Gruppe von Reihen, die die Spaltenköpfe der Tabelle definieren. Diese Reihen bilden die Spaltenüberschriften im HTML-Tabellen. Dieses Tag wird auch als <thead>-Element bezeichnet.
HTML-Tabelle mit <thead>-Elementen:
!doctype html> <html> <head> <meta charset="UTF-8"> <title>Verwendung des HTML thead-Tags (Grundlagen-Tutorial-Website oldtoolbag.com)</title> </head> <body> <table border="1"> <caption>Ratshaushaltsplan (in £) 2018</caption> <thead> <tr> <th scope="col">Artikel</th> <th scope="col">Ausgaben</th> </tr> </thead> <tbody> <tr> <th scope="row">Donuts</th> <td>3,000</td> </tr> <tr> <th scope="row">Stationery</th> <td>18,000</td> </tr> </tbody> </table> </body> </html>Testen Sie es heraus ‹/›
IEFirefoxOperaChromeSafari
Alle gängigen Browser unterstützen das <thead> Tag.
<thead> Tag wird verwendet, um den Tabellenkopf der HTML-Tabelle zu kombinieren.
<thead> Element sollte mit <tbody> und <tfoot> Elemente kombiniert, um die verschiedenen Teile der Tabelle (Kopf, Körper, Fuß) zu regeln.
Durch die Verwendung dieser Elemente wird es dem Browser ermöglicht, den Tabellenkörper unabhängig vom Tabellenkopf und -fuß zu scrollen. Beim Drucken langer Tabellen mit mehreren Seiten können Kopf und Fuß auf jeder Seite mit Tabellendaten gedruckt werden.
<thead> Tag muss in folgenden Situationen verwendet werden: Als Unter-element des <table> Elements, nach <caption> und <colgroup> Elementen, vor <tbody>. vor <tfoot> und <tr> Elementen.
Anmerkung:<thead> Element müssen mindestens einen oder mehrere <tr> Tags enthalten.
Hint:<thead>, <tbody>, and <tfoot> elements do not affect the table layout by default. However, you can use CSS to define styles for these elements and thus change the appearance of the table.
In HTML 5 No longer supports HTML 4.01 Any attribute of the <thead> tag.
Attribute | Value | Description |
---|---|---|
align | right left center justify char | HTML5 Not supported. Defines the alignment of the content within the <thead> element. |
char | character | HTML5 Not supported. Specifies the character to align the text by within the <thead> element. |
charoff | number | HTML5 Not supported. Specifies the offset of the first alignment character of the content within the <thead> element. |
valign | top middle bottom baseline | HTML5 Not supported. Specifies the vertical alignment of the content within the <thead> element. |
Support for <thead> Tag Global Attributes of HTML.
Support for <thead> Tag HTML Event Attributes.