Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#4542 closed bug (invalid)

[IE] table not 'setting' tbody properly when using .html on it.

Reported by: Christianh Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

For some reason in Internet Explorer (6,7 & 8) trying to set a table contents with .html doesn't work, this results in a empty table, However this does work in Firefox.

Example: html: <table id="test_id"></table>

js: $('#test_id").html("<tr><td>test</td></tr>");

-- I did find a fix by changing the js to: $('#test_id").children('tbody').html("<tr><td>test</td></tr>");

But now it doesn't work in firefox, however I did fix it by changing my html to: <table id="test_id"><tbody></tbody></table>

I expected .html to add a <tbody> to a table if it doesn't exists and set the <tbody> to the html value defined.

Change History (3)

comment:1 Changed 11 years ago by joern

Component: webcore
Owner: joern deleted

comment:2 Changed 11 years ago by dmethvin

You can't append a tr to a table. Tables can have multiple tbody tags. Although the innerHTML implementation of some browsers may try to create a valid tree by inserting tags for you, it is better to be specific.

comment:3 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.