#13647 closed bug (notabug)
Duplicate tbody when inserting row into table
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 2.0b1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When inserting a new <tr> into a table a new <tbody> will be inserted.
Change History (6)
comment:1 Changed 9 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
comment:2 Changed 9 years ago by
If I don't do something extremely wrong here, I think appending to the tbody makes it even worse: http://jsfiddle.net/q9HYu/3/
comment:3 Changed 9 years ago by
This works correctly on current jQuery 2.0 from git, although behaviour of jQuery 2.0b1 is, indeed, erroneous.
Could you advocate to jsFiddle somehow so that they introduce a jQuery 2.x edge option? It would be extremely useful...
Anyway, an updated test case with the current jQuery 2.0.0-pre: http://jsfiddle.net/q9HYu/7/
comment:4 Changed 9 years ago by
Here you can see that the inner structure is set correctly: http://jsfiddle.net/q9HYu/8/
comment:5 Changed 9 years ago by
Btw, working on table
instead of tbody
works, too: http://jsfiddle.net/q9HYu/9/
Line 315 of manipulation.js handle this:
callback.call( table && jQuery.nodeName( this[ i ], "table" ) ? findOrAppend( this[ i ], "tbody" ) : this[ i ], node, i );
comment:6 Changed 9 years ago by
(a little OT but related to what I wrote before - I created a ticket for adding jQuery 2.x edge lib to jsFiddle: https://github.com/jsfiddle/jsfiddle-issues/issues/355)
If you want the tr to go into the existing tbody then append it there.