PDA

View Full Version : counting no.of rows in table


phani
08-31-2002, 09:35 AM
Is there provision to count the no.of rows in a table. Here iam generating the rows dynamically.

Skyzyx
08-31-2002, 10:14 AM
do you have any sort of example code?

phani
08-31-2002, 10:36 AM
iam not having any sample code. Actually my problem is related to jsp which uses javascript. My actual problem is, i want to select all the checkboxes that generates dynamically. so i have provision for no.of rows i can do it. If you want the jsp code i will post it.

jkd
08-31-2002, 03:26 PM
refToTable.getElementsByTagName('tr').length;

joh6nn
08-31-2002, 09:51 PM
i know that IE has objects that are children of Tables, representing a collection of the Table's Rows. likewise, each Row has a collection of the Cells in it. i don't know if that's standard or not; i haven't ever really needed it, and as such, haven't experimented with it too much.

supposing it's standard, the code would look like this:

document.getElementById('table').rows.length;

phani
09-01-2002, 05:50 AM
thank u for all those who helped me. can u guide me in solving the problem relating to checkboxes i have posted.

ConfusedOfLife
09-01-2002, 04:39 PM
Well, I don't know why you just don't use a simple counter for your TRs, coz you said you're generating them dynamically, anyway, I don't know what you're exactly looking for by saying checkboxes, go to http://www.irandiba.net/confusedoflife/URLBook/

and see if it's what you want, at first make a "thread", or an "url", or several urls and threads! and you'll see the checkboxes.