検証(HTML5):要素 'th'を要素 'table'にネストすることはできません
-
21-12-2019 - |
質問
次のHTMLを考慮すると、なぜエラーが発生します。
検証(HTML5):要素 'th'を要素の 'table'
にネストできません
<table>
<th>ID</th>
<th>text header</th>
<tr>
<td>7</td>
<td>text</td>
</tr>
</table>
. 解決
<th>
の外側に<tr>
要素を持つことはできません。次のスニペットは有効です
<table>
<tr>
<th>ID</th>
<th>text header</th>
</tr>
<tr>
<td>7</td>
<td>text</td>
</tr>
</table>
.
<>使用状況コンテキスト HTTPS://developer.mozilla.org/en/docs/web/html/element/th
許可親要素
<tr>
要素
所属していません StackOverflow