Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

counting rows in javascript

 
kumar m
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JavaScript forum. This forum is for discussing Java.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!