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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -