I have added a bunch of items to an html table using javascript.
newCell0 = newRow.insertCell(cellCount);
newCell0.innerHTML = subInfo;
Now i want to go through the table and delete all the rows. I am trying this:
for(var i=1; i< count; i++)
{
tblBody.deleteRow(i);
}
However, it skips around! I even tried this:
tblBody.deleteRow(1);
tblBody.deleteRow(2);
tblBody.deleteRow(3);
tblBody.deleteRow(4);
tblBody.deleteRow(5);
tblBody.deleteRow(6);
tblBody.deleteRow(7);
After running that code, it deletes every other row! Which brings me to my next question? How the heck are rows numbered? I assumed it was 0,1,2,3,4,5,6,7 etc.