Javascript Reference
Categories: TABLE

javascript TABLE insertRow( )

@May 13, 2009, 3:36 p.m.
insertRow( ) Firefox/Netscape/NN 6 IE 4(Win) Chrome/Safari/DOM 1  



Inserts a tr element nested within the current table element. The integer parameter points to the zero-based index in the rows collection where the new row should go, but in IE you can also use the shortcut value of -1 to append the row to the end of the collection. Adding the row inserts an empty element, to which you add cells via the insertCell( ) method. Unfortunately, scripting the addition of table rows and cells in IE for the Macintosh (including Version 5.1) is very broken, yielding elephantine row and cell dimensions. For nonnested tables, you might be able to get away with regular document tree node creation and insertion instead of the table (and related) object convenience methods.

  • Zero-based integer corresponding to a row of the rows collection before which the new row is to be inserted.
Returned Value

Reference to the newly inserted row.

soypeestiff - 2013-12-26
I like this site.
brando - 2012-02-03

Powered by Linode.