English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das HTML <caption>-Tag definiert den Titel der Tabelle in einem HTML-Dokument. Traditionell rendern Browser den Text im <caption>-Tag oben in der Tabelle, aber Sie können CSS caption-Die side-Eigenschaft ändert dieses Verhalten. Dieser Tag wird oft auch als <caption>-Element bezeichnet.
Das HTML <caption>-Element (oder das HTML-Tabelle-Überschriftselement) zeigt eine Tabelle an, es erscheint oft als erster Unter-element des <table> und wird am Anfang des Tabelleninhalts angezeigt, kann aber auch mit CSS gestylt werden, daher kann es an jeder beliebigen Position relativ zur Tabelle erscheinen.
Tabelle mit Caption-Überschrift:
<!doctype html> <html> <kopf> <meta charset="UTF-8"> <titel>Grundlagen-Tutorial-Website(w3(codebox.com)</titel> </kopf> <body> <table> <überschrift>Dies ist der Überschrifttext für die Tabelle</überschrift> <tr> <th>Spalte 1 Überschrift</th> <th>Spalte 2 Überschrift</th> <th>Spalte 3 Überschrift</th> </tr> <tr> <td>Daten in der Spalte 1, Zeile 2</td> <td>Daten in der Spalte 2, Zeile 2</td> <td>Daten in der Spalte 3, Zeile 2</td> </tr> <tr> <td>Daten in der Spalte 1, Zeile 3</td> <td>Daten in der Spalte 2, Zeile 3</td> <td>Daten in der Spalte 3, Zeile 3</td> </tr> <tr> <td>Daten in der Spalte 1, Zeile 4</td> <td>Daten in der Spalte 2, Zeile 4</td> <td>Daten in der Spalte 3, Zeile 4</td> </tr> </table> </body> </html>Testen Sie es heraus ‹/›
IEFirefoxOperaChromeSafari
Alle gängigen Browser unterstützen das <caption>-Tag.
Das HTML <caption>-Element befindet sich innerhalb des <body>-Tags.
Das <caption>-Tag tritt als erster nach dem <table>-Tag auf.
The <table> tag is composed of <tr>, <th>, and <td> tags.
Most browsers will display the <caption> tag above the table, but you can use CSS caption-The side attribute changes this behavior.
The <caption> tag defines the title of the table.
The <caption> tag must be placed directly after the <table> tag.
Note: Only one title can be specified for each table.
Hint: By default, the table title will be centered above the table. However, the CSS property text-align and caption-side can be used for alignment and placement of the title.
The align attribute has been removed from HTML5Removed from HTML.
Attribute | Value | Description |
---|---|---|
align | left right top bottom | HTML5 Not supported. HTML 4.01 Deprecated.
Define the alignment of the title. |
Support for <caption> Tag Global Attributes of HTML.
Support for <caption> Tag HTML Event Attributes.