AvailabilityDOM Level 1 HTML SynopsisHTMLElement insertCell(long index) throws DOMException; Arguments
ReturnsAn HTMLTableCellElement object that represents the newly created and inserted <td> element. ThrowsThis method throws a DOMException with a code of INDEX_SIZE_ERR if index is less than zero or is greater than the number of cells in the row. DescriptionThis method creates a new <td> element and inserts it into the row at the specified position. The new cell is inserted immediately before the cell that is currently at the position specified by index. If index is equal to the number of cells in the row, the new cell is appended at the end of the row. Note that this convenience method inserts <td> data cells only. If you need to add a header cell into a row, you must create and insert the <th> element using Document.createElement( ) and Node.insertBefore( ) or related methods. |