PDA

View Full Version : Resetting row id's .. please help


paula dougherty
03-28-2007, 05:17 PM
Hi
I'm trying to rename row Id's in a table and then want to rename the cell id's within the row.
I'm having trouble renaming the row Id's andthen accessing the cells within the row.

Any help would be really appreciated as am starting to tear my hair out



var tbl = parent.expenseDisplay.document.getElementById('myTable');
var lastRow = tbl.rows.length;
var tableRows = tbl.rows

for (var i = 1; i <= lastRow; i++) {
newLine = tableRows[i]
newLine.id = "row"+i
}

david_kw
03-28-2007, 06:36 PM
One potential problem is that the rows would at index 0 through length - 1 so

for (var i = 1; i <= lastRow; i++) {

should be

for (var i = 0; i < lastRow; i++) {

david_kw