Home JQuery How to count the number of table rows within an html table using JQuery?
 
 
 

How to count the number of table rows within an html table using JQuery?

PDF Print E-mail

Question: How to count the number of table rows within an html table using JQuery?

 

Answer:

var countRows = $('#tableID tr').length; 
alert(countRows)

or

var countRows = $('#tableID tr').size;
alert(countRows)
 

The selector takes all rows and then counts them.

+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!