deleteRow

HTML (DHTML)

deleteRow Method

Internet Development Index

Removes the specified row (tr) from the element and from the rows collection.

Syntax

object.deleteRow( [iRowIndex])

Parameters

iRowIndex Optional. Integer that specifies the zero-based position in the rows collection of the row to remove.

Return Value

No return value.

Remarks

If you delete a row from a tFoot, tBody, or tHead, you also remove the row from the rows collection for the table. Deleting a row in the table also removes a row from the rows collection for the tBody.

If you delete a row from a tFoot, tBody, or tHead, iRowIndex must contain the sectionRowIndex of the tr. When deleting a row from the table, iRowIndex must contain the rowIndex of the tr.

Example

This example uses the deleteRow method to delete the specified row (tr) in the table.

document.all.myTable.deleteRow()

Standards Information

This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

TABLE, TBODY, TFOOT, THEAD

See Also

insertRow, rowIndex, rows, sectionRowIndex