http://jsbin.com/utisoz/edit#javascript,html
Ive created a simple table without Tbody
how ever it seems that it must generate Tbody.
why is that ?
does Table always generates Tbody ?
http://jsbin.com/utisoz/edit#javascript,html
Ive created a simple table without Tbody
how ever it seems that it must generate Tbody.
why is that ?
does Table always generates Tbody ?
In HTML 4 a table is required to have a tbody child, but its start and end tags are optional.
<!ELEMENT TABLE - -
(CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
<!ELEMENT TBODY O O (TR)+ -- table body -->
Some browsers do not respect this. So you may or may not get one depending on the browser.
this is not the real HTML, the developer tool will add the tbody tag , but if you see the HTML source , you don't see the tbody tag
I believe that for HTML4 valid markup a tbody will always be generated. It's not always true of invalid markup, and it's not necessarily true for HTML5 valid markup either. For instance, consider this markup which (with an appropriate DOCTYPE) is valid HTML5 but not valid HTML4.
<title>Test Case</title>
<table>
<thead>
<tr>
<td></td>
</tr>
</thead>
</table>
This table will not have a tbody
element.