aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Using InnerHTML to Add Dynamic Rows to Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Using InnerHTML to Add Dynamic Rows to Table" Watch "Using InnerHTML to Add Dynamic Rows to Table" New topic
Author

Using InnerHTML to Add Dynamic Rows to Table

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I want to add some rows to a table dynamically. With DOM, I need to do many document.createElement() to create the <tr>,<td> and lots of other formatting elements. But is there a simplier way to do this? MSDN says .innerHTML for <tr> is readonly so I cannot simply modify this property.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You have the option of using createElement or insertRow()/insertCell()

Eric
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Using InnerHTML to Add Dynamic Rows to Table