insertRowinsertRow*
*Contents  *Index  *Topic Contents
*Previous Topic: insertCell
*Next Topic: isEqual

insertRow

Description

Creates a new row (TR) in the table and adds the row to the rows collection. Inserting a row in a TFOOT, TBODY, or THEAD also adds a row to the rows collection for the TABLE. Inserting a row in the TABLE, adds a row to the rows collection for the TBODY. If specifying an index, the index should be relative to the rows collection for the element which first contains the TR. For example, insertRow for a TBODY would take an index value relative to the rows collection that is on the TBODY, not the TABLE.

Syntax

object.insertRow(index)

Return Value

Returns the TR element object. If the method fails, it returns null. Index is optional. Default value is "-1" which appends the TD to the end of the rows collection.

Remarks

The following example adds a row to the TABLE,

myNewRow = document.all.myTable.insertRow()

Applies To

table, TBODY, TFOOT, THEAD

See Also

rows, rowIndex, sectionRowIndex


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.