Results 1 to 2 of 2
Nov 18, 2007, 01:29 #1
How to dynamically add rows to a table?
I have the following table definition:
<table id="mytable" cellpadding="0" cellspacing="0"></table/>
First I tried something like this:
var table = document.getElementById('mytable');
table.innerHTML += newRow;
Where newRow is a variable that holds the <tr><td>...</td></tr> content.
This solution didn't work in IE and after reading, I found out that the innerHTML attribute is read only for the <table> tag in IE. In Firefox it works but this is not good enough for me...
Nov 18, 2007, 02:16 #2
- Join Date
- Jan 2003
- Outside the bubble
- 0 Post(s)
- 0 Thread(s)
I'm no expert, but achieved a similar thing using JQuery (using append or prepend)