This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes counting rows in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "counting rows in javascript" Watch "counting rows in javascript" New topic

counting rows in javascript

kumar m

Joined: Aug 20, 2002
Posts: 13
Hi All,
I have problem in counting number of rows in a table and giving color to table data in javascript.
I'm able to dynamically add rows to html table, but how to count no. of rows in the table after adding rows.
Please give a solution to me to add row dynamically and also to count the rows.
I'm using insertRow and insertCell methods to add row dynamically in javascript.

waiting for your reply.
Thank you Regards
Daniel Ng

Joined: Jul 09, 2002
Posts: 27
inserted.insertRow(string[] data, int index)
Use data.length to get the number of rows.
As for the color, I am not sure how to do that with insertRow().
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Moving this to the JavaScript forum. This forum is for discussing Java.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: counting rows in javascript
It's not a secret anymore!