Which DOM elements can be child of tr?
W3C specify this stuff. For tr
, you can find it here. Basically, only th
and td
elements can be direct contents of tr
.
If you want other stuff inside your table, it has to go inside the td
or th
elements. For example, td
can contain flow elements, including div
.
The HTML spec states:
Permitted contents
Zero or more of: one
td
element, or oneth
element
<tr>
elements can contain only <td>
s and <th>
s.