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

HTML DOM Table insertRow() method

Table insertRow() method

Table Object Reference Table object


Definition and Usage

The insertRow() method is used to insert a new row at a specified position in a table.

Syntax

tableObject.insertRow(

index

)

Value Description
index

Specifies the position where the new row is inserted (starting at 0).


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the insertRow() method


Example

Example

Insert a new row at the first position of a table:

Runoob Tutorial(runoob.com)

    

        

        

    

    

        

        

    

cell 1 cell 2
cell 3 cell 4

Try it »


Table Object Reference Table object