javascript - dynamically show n hide table rows using jquery :gt -
i wondering how use jquery's :gt() in inclusive way. trying show/hide table rows dynamically.
$('#' + tbodyid + ' > tr:gt(' + newrowstart + '):lt(' + rowstoshow + ')').show(); if try show first 5 rows say, newrowstart = 0 , rowstoshow = 5. not show first row. setting -1 doesn't work either. helpful if there inclusive method :gt(). know how this?
one option use slice():
$('#'+tbodyid) .find('tr') .slice( newrowstart, newrowstart + rowstoshow ) // inclusive of starting point .show();
Comments
Post a Comment