David
David

Reputation: 728

jQuery display 5 records on multiple tables

I have multiple tables using tablesorter on a page but only need to show the top 5 results on each.

I have tried to expand on this but it is only keeping first in the first table. I need this done on each table.

$('.tablesorter > tbody').children('tr:not(:first)').remove();

Upvotes: 0

Views: 364

Answers (1)

Robin Maben
Robin Maben

Reputation: 23074

$('.tablesorter > tbody')each(function(){
   $(this).children('tr:lt(5)').remove();
});

Upvotes: 1

Related Questions