Javascript Reference
Categories: TABLE

javascript TABLE deleteRow( )

@March 15, 2008, 1:22 a.m.
deleteRow( )Firefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 1  

deleteRow(index)

  

Removes a tr element nested within the current table element. The integer parameter points to the zero-based item in the rows collection. To repopulate a table with new or sorted content, empty the table (or just a table section) with iterative calls to the deleteRow( ) method:

while (tableReference.rows.length> 0) {
     tableReference.deleteRow(0);
}
 
Parameters
 
  • Zero-based integer corresponding to the said numbered tr element in source code order (nested within the current element).
 
Returned Value

None.


Powered by Linode.