Das caption-Tag
Das Tag caption dient dazu, einen
Titel für eine gesamte HTML-Tabelle zu erstellen.
Ein solcher Titel ist ein Text, der standardmäßig
vor der Tabelle angezeigt wird und deren Inhalt
beschreibt.
Dieses Tag kann nur innerhalb des
table-Tags
platziert werden, und zwar direkt nach dem öffnenden Tag.
Beispiel
Fügen wir der Tabelle einen Titel caption hinzu:
<table>
<caption>this is the title of the entire table</caption>
<tr>
<th>Name</th>
<th>Surn</th>
<th>Salary</th>
</tr>
<tr>
<td>name1</td>
<td>surn1</td>
<td>200$</td>
</tr>
<tr>
<td>name2</td>
<td>surn2</td>
<td>1000$</td>
</tr>
</table>
table, td, th {
border: 1px solid black;
}
: