Anyway to Clear / Delete / Remove all rows from an HTML Table 
Author Message
 Anyway to Clear / Delete / Remove all rows from an HTML Table

I have worked out how to dynamically create rows and cells of a table

myrow = document.all.tablename.insertrow()
mycell = myrow.insertcell()

mycell.innerhtml = "values"

but how do I delete them to re-create it with new data.  Deleterow()
seems a bit crude and as it does not take a number value, probably a
bit slow, if the original table is big.

Also why does document.all.tabname.rows.length = 1 when no rows have
been added to a table nor have any been specified in original HTML


<table id="testtab"></table>

Thanks for any help


Mon, 26 Jan 2004 03:10:21 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Dinamicly removing rows from table

2. Dynamic adding/removing rows fro ma table

3. Delete Table Row

4. Delete Table Row

5. Dynamically Delete rows in a table???

6. Getting row/column index of HTML TABLE cell

7. Using HTML table rows collection with VBScript

8. show/hide an html table row

9. Accesing cells in related rows in HTML table????

10. Color Changing in rows of HTML table.

11. Delete / remove HTML tags / elements

12. table row text will not show after row insert


Powered by phpBB® Forum Software