I have problem becouse I want to surround some of td
inside tr
so I need to know.
Which DOM elements can be child of tr? (I know div
cannot.)
HTML tr element can reside within table element, th, col, colgroup, tbody elements.
The <tr> element may be a direct child of a <table> element or nested within a parent <thead>, <tfoot>, or <tbody> element.
html - div not allowed as child element of button - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With