Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear whether omitting <tbody> tags (putting <tr> directly under <table>) is valid #33618

Closed
BrianJDrake opened this issue May 15, 2024 · 0 comments · Fixed by #34062
Closed
Labels
Content:HTML Hypertext Markup Language docs help wanted If you know something about this topic, we would love your help!

Comments

@BrianJDrake
Copy link

MDN URL

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

What specific section or headline is this issue about?

Technical summary

What information was incorrect, unhelpful, or incomplete?

The MDN <tbody> technical summary says:

A <tbody> element's start tag can be omitted if the first thing inside the <tbody> element is a <tr> element, and if the element is not immediately preceded by a <tbody>, <thead>, or <tfoot> element whose end tag has been omitted. (It can't be omitted if the element is empty.) A <tbody> element's end tag can be omitted if the <tbody> element is immediately followed by a <tbody> or <tfoot> element, or if there is no more content in the parent element.

That implies that this markup, which omits the <tbody> tag and puts <tr> directly under <table>, is valid:

<table>
    <tr></tr>
</table>

It should be considered valid, even though it really means this:

<table>
    <tbody>
        <tr></tr>
    </tbody>
</table>

But in #33505, which is basically the same issue on the <tr> page, the reporter @rschristian is adament that the shorter form is not valid. I did mention the <tbody> page, but nothing came of it, so I am opening an issue specifically for the <tbody> page.

What did you expect to see?

See above.

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
@BrianJDrake BrianJDrake added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 15, 2024
@github-actions github-actions bot added the Content:HTML Hypertext Markup Language docs label May 15, 2024
@Josh-Cena Josh-Cena added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jun 5, 2024
estelle added a commit that referenced this issue Jun 11, 2024
wbamberg added a commit that referenced this issue Jun 12, 2024
* #33618: clarify omitting <tbody>

hopefully fixes #33618

* Update files/en-us/web/html/element/tbody/index.md

Co-authored-by: wbamberg <will@bootbonnet.ca>

* Update files/en-us/web/html/element/tbody/index.md

---------

Co-authored-by: wbamberg <will@bootbonnet.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs help wanted If you know something about this topic, we would love your help!
2 participants