Alex Rivera | Logout

Are html tables valid if there are multiple tbody tag used?

Asked 2011-02-02T11:10:00.280
14

If there are multiple <tbody> tags in an HTML <table>, is this valid?

<table>
    <tbody>
    </tbody
    <tbody>
    </tbody
</table>
Edit
Report

2 Answers

22

Yes, the DTD shows that it is allowed.

<!ELEMENT table
     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>

The DTD also has a comment which explains why:

Use multiple tbody sections when rules are needed between groups of table rows.

answered 2011-02-02T11:15:49.287
5

I copy pasted your title in google and the first link is : http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3 ,

"Table rows may be grouped into a table head, table foot, and one or more table body sections",

so yes you can !

answered 2011-02-02T11:15:05.020

Your Answer