Skip to content

“Start tag in table body” message for <thead><th></th></thead> is confusing #102

Open

Description

@kaizhu256

see screenshot

image

html code:

<!DOCTYPE html>
<html lang="">
<head>
<title>Test</title>
</head>
<body>
<p></p>
<table>
    <thead>
        <th></th>
    </thead>
</table>
</body>
</html>

Activity

  1. sideshowbarker commented on Dec 23, 2020

    @sideshowbarker
    Member

    Agreed that error message is confusing.

    I’m inclined to think it should just be changed to “th start tag not within tr element”.

    But to be clear one thing: the “in table body” in that error message does not mean “in the tbody element”.

    If you go to https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-intable and then scroll to the part which says, “A start tag whose tag name is one of: "tbody", "tfoot", "thead"”, you’ll notice it then says, “switch the insertion mode to "in table body"”.

    That is, it says the parser must switch into the "in table body" insertion mode even though it actually could be within a thead or tfoot element — not just within a tbody element.

    And then if you go to https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-intbody and see the part that says, “A start tag whose tag name is one of: "th", "td"”, that’s the part of the spec that this error message corresponds to.

  2. kaizhu256 commented on Dec 23, 2020

    @kaizhu256
    Author

    oh thx. fixed the lint error now that i know what it is. will leave issue open if there's interest in fixing the message. otherwise feel free to close this.

  3. self-assigned this
    on Dec 19, 2025
  4. changed the title [-]validation-bug - parser confuses <thead> for <tbody>[/-] [+]“Start tag in table body” message for <thead><th></th></thead> is confusing[/+] on Dec 19, 2025
  5. j9t commented on Jan 14, 2026

    @j9t

    @sideshowbarker, team, could someone unassign me from this? Seems the assignment got carried over but I’m not the best person to handle this in this repo 🙂

  6. sideshowbarker commented on Jan 15, 2026

    @sideshowbarker
    Member

    @sideshowbarker, team, could someone unassign me from this? Seems the assignment got carried over but I’m not the best person to handle this in this repo 🙂

    Yup, done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions