You can use :visible selector and .length like this:
var numOfVisibleRows = $('tr:visible').length;
If <table> not displayed on the screen ( :visible returns false, if any parent is hidden, the element doesnβt need to be hidden directly), then use .filter() , for example:
var numOfVisibleRows = $('tr').filter(function() { return $(this).css('display') !== 'none'; }).length;
Nick Craver May 28 '10 at 19:24 2010-05-28 19:24
source share