Section 25.274. TableRow.insertCell( ): insert a new, empty td element into a table row


25.274. TableRow.insertCell( ): insert a new, empty <td> element into a table row

DOM Level 2 HTML

25.274.1. Synopsis

 HTMLElement insertCell(long index)     tHRows DOMException; 

25.274.1.1. Arguments

index

The position at which the new cell is to be inserted.

25.274.1.2. Returns

An TableCell object that represents the newly created and inserted <td> element.

25.274.1.3. Throws

This 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.

25.274.2. Description

This 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 to 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.




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net