96
TherowIndexattribute must, if this element has a parenttablep394
element, or a parenttbodyp404
,theadp405
, ortfootp406
element and a
grandparenttablep394
element, return the index of thistrp407
element in thattablep394
element'srowsp397
collection. If there is no such
tablep394
element, then the attribute must return −1.
ThesectionRowIndexattribute must, if this element has a parenttablep394
,tbodyp404
,theadp405
, ortfootp406
element, return the index of
thetrp407
element in the parent element'srowscollection (for tables, that'sHTMLTableElementp394
'srowsp397
collection; for table sections,
that'sHTMLTableSectionElementp404
'srowsp405
collection). If there is no such parent element, then the attribute must return −1.
Thecellsattribute must return anHTMLCollection
rooted at thistrp407
element, whose filter matches onlytdp409
andthp410
elements that are
children of thetrp407
element.
TheinsertCell(index)method must act as follows:
1. Ifindexis less than −1 or greater than the number of elements in thecellsp408
collection, then throw an"IndexSizeError"
DOMException
.
2. Lettable cellbe the result ofcreating an element
given thistrp407
element'snode document
,tdp409
, and theHTML namespacep97
.
3. Ifindexis equal to −1 or equal to the number of items incellsp408
collection, thenappend
table cellto thistrp407
element.
4. Otherwise,insert
table cellas a child of thistrp407
element, immediately before theindexthtdp409
orthp410
element in thecellsp408
collection.
5. Returntable cell.
ThedeleteCell(index)method must act as follows:
1. Ifindexis less than −1 or greater than the number of elements in thecellsp408
collection, then throw an"IndexSizeError"
DOMException
.
2. Ifindexis −1, thenremove
the last element in thecellsp408
collection from its parent, or do nothing if thecellsp408
collection is empty.
3. Otherwise,remove
theindexth element in thecellsp408
collection from its parent.
tr.rowIndexp408
Returns the position of the row in the table'srowsp397
list.
Returns −1 if the element isn't in a table.
tr.sectionRowIndexp408
Returns the position of the row in the table section'srowsp405
list.
Returns −1 if the element isn't in a table section.
tr.cellsp408
Returns anHTMLCollection
of thetdp409
andthp410
elements of the row.
cell=tr.insertCellp408( [index] )
Creates atdp409
element, inserts it into the table row at the position given by the argument, and returns thetdp409
.
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"
DOMException
.
tr.deleteCellp408(index)
Removes thetdp409
orthp410
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"
DOMException
.
408