Which element should be used for table headers, <caption>or <th>?
<caption>
<th>
For example, I want to create this table:
What's better,
<tr><th colspan="2">Discographie</th></tr>
or
<caption style="font-weight: bold">Discographie</caption>
?
th matches the column heading, so in this case: "Album" and "AnnΓ©e"
th
W3C: "The th element represents the header cell in the table." http://www.w3.org/TR/html-markup/th.html
caption matches the name / description of the whole table, so yes, itβs better to use the signature for "Discography".
caption
W3C: " caption , ". http://www.w3.org/TR/html-markup/caption.html
,