Hi,
I need to insert rows dynamically in a table. I know I can do that with
following code.
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length;
var row = tbl.insertRow(lastRow);
// left cell
var cellLeft = row.insertCell(0);
textNode = document.createTextNode("2828233665" + rownum++);
cellLeft.appendChild(textNode);
But what I want is not create cells and add it, but to add the whole
row with content something like this.
var row = tbl.insertRow(lastRow);
row.setContent("<td>"1"</td><td>"2"</td>")
In other words I get the whole row text and I want to insert that as
row, insted of column by column. Couldn't find a way to do that.
Any thoughts ???
_Pete
I need to insert rows dynamically in a table. I know I can do that with
following code.
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length;
var row = tbl.insertRow(lastRow);
// left cell
var cellLeft = row.insertCell(0);
textNode = document.createTextNode("2828233665" + rownum++);
cellLeft.appendChild(textNode);
But what I want is not create cells and add it, but to add the whole
row with content something like this.
var row = tbl.insertRow(lastRow);
row.setContent("<td>"1"</td><td>"2"</td>")
In other words I get the whole row text and I want to insert that as
row, insted of column by column. Couldn't find a way to do that.
Any thoughts ???
_Pete