Skip to content

table with thead but no tbody is valid or invalid? #21818

@BartolomeSintes

Description

@BartolomeSintes

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody

What specific section or headline is this issue about?

"Tag omission" and "Usage notes"

What information was incorrect, unhelpful, or incomplete?

According to the W3C validator a table with thead element and no tbody element is valid.

  <table>
    <thead>
      <tr><th>Country</th></tr>
    </thead>
    <tr><td>Spain</td></tr>
    <tr><td>France</td></tr>
  </table>

Validator screenshot:
w3c-validator-bug-2022-10-21
But MDN states in this page that:

  • Tag omission. The tbody element is not a required child element for a parent table element to graphically render. However, it must be present, if the parent table element has a thead, a tfoot or another tbody element as a child.
  • Usage notes. If the table includes a thead block (to semantically identify header rows), the tbody block must come after it.

I have opened an issue in the W3C Validator GitHub asking them if it is a bug of the validator. I have been told that W3C Validator is right and MDN is wrong, so I am opening this issue.
Can you check it?
Thanking you in advance,
Bartolome Sintes

What did you expect to see?

If the W3C Validator is right and the tbody tag is not needed when there is only one tbody element in a table, I would say that the page has to be corrected accordingly, removing the two sentences I have copied from the MDN page.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:HTMLHypertext Markup Language docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions