This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes DOM scripting - new rows in a table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DOM scripting - new rows in a table" Watch "DOM scripting - new rows in a table" New topic
Author

DOM scripting - new rows in a table

Greg A Watson
Greenhorn

Joined: Mar 28, 2006
Posts: 6
I'm trying to use the response from an Ajax to create a new row in a table element. Code is something like this:



This all works in fine in Firefox. In IE(7), no new row appears - however, if I look at the DOM using the IE Developer Toolbar, the new row & cells have been inserted at the correct position in the DOM.

Any ideas? All help much appreciated...

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You should be appending the rows to the tbody and not the table itself

Here is a basic working example


Eric
 
 
subject: DOM scripting - new rows in a table
 
Similar Threads
How to add table elements in mobile browser?
IE appendChild Not Working
creating tables with DOM / IE
Appending new table to existing table
building a html table, ID