Select Page

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

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

or

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

The selector takes all rows and then counts them.

Related Articles

Last Updated On March 21, 2018

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.