tr elementthead element.tbody element.tfoot element.table element, after any caption, colgroup, and thead elements, but only if there are no
tbody elements that are children of the
table element.td or th elements
interface HTMLTableRowElement : HTMLElement {
readonly attribute long rowIndex;
readonly attribute long sectionRowIndex;
readonly attribute HTMLCollection cells;
HTMLElement insertCell(optional long index);
void deleteCell(long index);
};
The tr element represents
a row of cells in a table.
rowIndexReturns the position of the row in the table's rows
list.
Returns −1 if the element isn't in a table.
sectionRowIndexReturns the position of the row in the table section's
rows
list.
Returns −1 if the element isn't in a table section.
cellsReturns an HTMLCollection
of the td and th elements of the row.
insertCell(
[ index ] )Creates a td element, inserts it into the table row at the
position given by the argument, and returns the td.
The position is relative to the cells in the row. The index −1, which is the default if the argument is omitted, is equivalent to inserting at the end of the row.
If the given position is less than −1 or greater than the number
of cells, throws an IndexSizeError
exception.
deleteCell(index)Removes the td or th element with the given position in the
row.
The position is relative to the cells in the row. The index −1 is equivalent to deleting the last cell of the row.
If the given position is less than −1 or greater than the index
of the last cell, or if there are no cells, throws an
IndexSizeError exception.