Note : The Rows collection is Internet Explorer 4.0 specific. For properties, methods and events that are supported by <TR>
element, see its topic.
The Rows collection is an ordered, indexed array, containing a reference to every row in contained in the <THEAD>
, <TBODY>
and <TFOOT>
sections of a referenced <TABLE>
element. This is a collection containing <TR>
elements. Note that the Rows Collection for each <THEAD>
, <TBODY>
, <TFOOT>
and the main <TABLE>
element are subtly different. Each <TR>
element that specifies a Row in the Rows Collection will have a reference in one of the Rows Collections for either the <THEAD>
, <TBODY>
, or <TFOOT>
elements and a reference in the Rows Collection of the main <TABLE>
element.
Rows Objects would normally be retrieved by their index in the Rows collection (for example document.MyTable.rows(3)
contains a reference to the 4th row in the table referenced by the MyTable
reference (this could be the <TABLE>
's ID
attribute), but a string value can be used, as long as that string is a valid identifier (ID
attribute value) for a <TABLE>
element in the document.
E.g.
document.MyTable.rows('MySecondRow').bgColor
...would return the value of the BGCOLOR
attribute for the <TR>
element whose ID
property is MySecondRow
, contained in the <TABLE>
element referenced by MyTable
length
The length
property returns the number of <TR>
elements in the collection. Note that the length
count starts at 1, not 0 as the rows collection index does. Therefore, the length
property may return a value of 5, but to access the 3rd row, you'd need to use document.MyTable.rows(2).property
item
The item
method retrieves single items, or sub-collections from the rows collection. It accepts the following arguments:
<TABLE>
reference.item(index, sub-index)
If index
is a number, then the method returns a reference to the row object at that position in the row collections index.
If the index
argument is a string value, then the item
method returns a sub-collection, containing a reference to every row in the table that has its ID
or NAME
attribute set to the string contained in the index
argument. To retrieve certain element objects from this sub-collection, the sub-index
argument must be used.
© 1995-1998, Stephen Le Hunte
file: /Techref/language/html/ib/Scripting_Reference/rowscol.htm, 4KB, , updated: 2004/3/1 15:47, local time: 2024/12/3 20:44,
3.145.103.100:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/Techref/language/html/ib/Scripting_Reference/rowscol.htm"> The Rows collection</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.