Javascript Reference
Categories: TR

javascript TR insertCell( )

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

insertCell(index)

  

Inserts a td element nested within the current tr element. The integer parameter points to the zero-based index in the cells collection where the new cell should go, but in IE you can also use the shortcut value of -1 to append the cell to the end of the collection. Adding the cell inserts an empty element, to which you add content via the various document tree modification techniques. 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 section object convenience methods.

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

Reference to the newly inserted cell.


Powered by Linode.