English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das HTML-Table-Body-Element (<tbody>) umschließt eine Gruppe von Tabellenzeilen (<tr>-Elemente), die den Tabellenkörper (<table>) darstellen.
Tabelle mit <thead>、<caption>、<tfoot> und <tbody>-Elementen:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Grundlagenlehrbuch(oldtoolbag.com)</title> <style type="text/css"> thead {color:#009900;} tbody {color:#0000cc;} tfoot {color:#ff0000;} </style> </head> <body> <table border="1"> <caption>Ratshaushaltsplan 2020</caption> <thead> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tfoot> <tr> <td>Sum</td> <td>$180</td> </tr> </tfoot> <tbody> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </tbody> </table> <p><b>Hinweis:</b> thead, tbody, und tfoot Elemente beeinflussen standardmäßig nicht das Layout der Tabelle. Allerdings können Sie CSS verwenden, um für diese Elemente Stile zu definieren und das Aussehen der Tabelle zu ändern.</p> </body> </html>Testen Sie es heraus ‹/›
IEFirefoxOperaChromeSafari
Alle gängigen Browser unterstützen das <tbody>-Tag.
Das <tbody>-Tag wird verwendet, um den Inhalt des Tabellenkörpers einer HTML-Tabelle zusammenzufassen.
Das <tbody>-Element sollte mit <thead> und <tfoot> Die Elemente zusammen verwendet, um die verschiedenen Teile der Tabelle (Körper, Kopf, Fuß) zu regeln.
Durch die Verwendung dieser Elemente wird der Browser in der Lage sein, den Inhalt des Tabellenkörpers unabhängig vom Tabellenkopf und Tabellenfuß zu scrollen. Wenn lange Tabellen mit mehreren Seiten gedruckt werden, können der Tabellenkopf und der Tabellenfuß auf jeder Seite mit Tabellendaten gedruckt werden.
Das <tbody>-Tag muss in folgenden Situationen verwendet werden: Als Unterlement des <table>-Elements, nach den <caption>, <colgroup> und <thead>-Elementen.
Hinweis:Das <tbody>-Element muss eine oder mehrere <tr>-Tags enthalten.
Hinweis:Das <tbody>-Tag muss nach den <caption>, <colgroup> und <thead>-Tags in einer Tabelle erscheinen, aber vor dem <tfoot>-Tag.
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, thus changing the appearance of the table.
In HTML 5 No longer supports HTML 4.01 Any attribute of the <tbody> tag.
Attribute | Value | Description |
---|---|---|
align | right left center justify char | HTML5 Not supported. Defines the alignment method of the content within the <tbody> element. |
char | character | HTML5 Not supported. Specifies which character the content within the <tbody> element is aligned to. |
charoff | number | HTML5 Not supported. Specifies the offset of the first alignment character within the <tbody> element. |
valign | top middle bottom baseline | HTML5 Not supported. Specifies the vertical alignment of the content within the <tbody> element. |
<tbody> Tag supports Global Attributes of HTML.
<tbody> Tag supports HTML Event Attributes.