Skip to main content

Bug Tracker

Side navigation

#4542 closed bug (invalid)

Opened April 16, 2009 09:57AM UTC

Closed December 10, 2009 04:16AM UTC

Last modified March 13, 2012 05:09PM UTC

[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.

Attachments (0)
Change History (3)

Changed June 10, 2009 07:52AM UTC by joern comment:1

component: webcore
owner: joern

Changed August 09, 2009 12:54AM UTC by dmethvin comment:2

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.

Changed December 10, 2009 04:16AM UTC by dmethvin comment:3

resolution: → invalid
status: newclosed