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

Table with tfoot inside plain table results in weird DOM #3439

Closed
ShyLionTjmn opened this issue Dec 8, 2016 · 7 comments
Closed

Table with tfoot inside plain table results in weird DOM #3439

ShyLionTjmn opened this issue Dec 8, 2016 · 7 comments
Labels

Comments

@ShyLionTjmn
Copy link

@ShyLionTjmn ShyLionTjmn commented Dec 8, 2016

Create simple table with THEAD,TFOOT and TBODY tags and insert it into plain table with just TR and TD.
You will get broken table.

Here is an example:
https://jsfiddle.net/5kbwkzq8/5/

@timmywil
Copy link
Member

@timmywil timmywil commented Dec 19, 2016

It seems like the same thing would happen without jQuery. We can't stop you from building invalid html. However, the test case is pretty large. Would it be possible to reduce this even further? There's a lot going there.

@timmywil timmywil added Needs info and removed Needs review labels Dec 19, 2016
@gibson042
Copy link
Member

@gibson042 gibson042 commented Dec 19, 2016

Ok, this one is kind of cool. A <tr> is being appended to a table that has no <tbody>, but contains an inner table that does have one. And when we try to find a <tbody> to contain the incoming row, we mistakenly use the one from the inner table. This should be a straightforward fix.

@gibson042 gibson042 added Bug and removed Needs info labels Dec 19, 2016
@timmywil
Copy link
Member

@timmywil timmywil commented Dec 19, 2016

Thanks for digging into that!

@ShyLionTjmn
Copy link
Author

@ShyLionTjmn ShyLionTjmn commented Dec 20, 2016

Why is it invalid? TBODY is not required when TR comes right after TABLE.

@timmywil
Copy link
Member

@timmywil timmywil commented Dec 20, 2016

@ShyLionTjmn at first glance, it looked like an unclosed tag or something, but @gibson042 dug further and it is a jQuery bug.

@ShyLionTjmn
Copy link
Author

@ShyLionTjmn ShyLionTjmn commented Dec 21, 2016

Ok. Thanks.

@leonardjo
Copy link

@leonardjo leonardjo commented Dec 24, 2016

Seems indeed to be a duplicate of the issue I'm having. Commit 1f614ed fixes the issue I see. Thank you.

gibson042 added a commit that referenced this issue Jan 9, 2017
For performance, use a querySelectorAll path instead of Javascript iteration.
http://codepen.io/anon/pen/vywJjx?editors=1010

Fixes gh-3439
Closes gh-3463
@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.