[thelist] MSIE 6 & appendChild on a table

Andrew Clover and-evolt at doxdesk.com
Sat Sep 24 13:19:46 CDT 2005


Maximillian Schwanekamp wrote:

> I'm making a script to add rows to a table via clientside dom scripting, 
> but I cannot seem to make it work in IE.

A <table> element has its rows in separate child elements for <thead>, 
<tbody> and <tfoot>. When you're writing HTML you can miss out those 
tags and the browser will put the implied <tbody>s in for you. However 
as far as the HTML DOM is concerned the <tbody> is very much there and 
rows have to go inside it.

So to add rows in a way that's more likely to work, add them to the 
tbody element:

   answersTable.tBodies[0].appendChild(newClone);

-- 
And Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/


More information about the thelist mailing list