English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

HTML-Tag-Übersicht

HTML: <thead> Tag

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.

Online-Beispiel

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 ‹/›

Browser-Kompatibilität

IEFirefoxOperaChromeSafari

Alle gängigen Browser unterstützen das <thead> Tag.

Definition und Verwendungshinweise

<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.

Hinweise und注意事项

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.

HTML 4.01 and HTML5differences between

In HTML 5 No longer supports HTML 4.01 Any attribute of the <thead> tag.

Attribute

AttributeValueDescription
alignright
 left
 center
 justify
 char
HTML5 Not supported. Defines the alignment of the content within the <thead> element.
charcharacterHTML5 Not supported. Specifies the character to align the text by within the <thead> element.
charoffnumberHTML5 Not supported. Specifies the offset of the first alignment character of the content within the <thead> element.
valigntop
 middle
 bottom
 baseline
HTML5 Not supported. Specifies the vertical alignment of the content within the <thead> element.

Global Attributes

Support for <thead> Tag Global Attributes of HTML.

Event Attributes

Support for <thead> Tag HTML Event Attributes.