Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Table deleteRow() method

Table deleteRow() method

Table Object Reference Table object


Definition and Usage

The deleteRow() method is used to delete a row at a specified position from a table

Syntax

tableObject.deleteRow(

index

)

Value Description
index Specifies the numeric index of the row to delete (starting at 0).

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the deleteRow() method


Example

Example

Delete the first row of a table:

Runoob Tutorial(runoob.com)

    

        

        

    

    

        

        

    

cell 1 cell 2
cell 3 cell 4

Try it »


More examples

Delete a table row after a click
This example uses the deleteRow() method to delete a row after clicking


Table Object Reference Table object