This collection includes any cells inside objects instantiated by <TBODY>, <TFOOT> and <THEAD> tags.
This is not necessarily the same as the cells collection returned from a TBODY object.
Addressing the table by means of its cells[] collection allows you to visit all the cells in a single enumeration loop rather than having to nest a loop for each axis of the table.
The columns and rows are different axes of the table. However, they are described in different ways. The cols value is simply an integer that is set to the number of columns. The rows property is a reference to a collection of objects, one row object for each row in the table. Therefore to establish how many cells there are in the table, you need to multiply the table.cols value by the table.rows.length value.
The table.cols value should also be equivalent to table.rows.cells.length value as well.
Prev | Home | Next |
TABLE.cellPadding | Up | TABLE.cellSpacing |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |