Hide all rows of a table after a specific number?

I would like to write a code where it displays the full list for the year, but initially only the first 6 weeks (so, 42 days), and then you can click the button to view the rest (no switch needed).

I was going to do this with PHP and set up a class for each of the ones I want to hide, and that's fine, I think I was just not sure if there was a more efficient way to do this in jQuery.

+6
source share
2 answers
$("table tr:gt(5)").hide(); 

will hide all of them after / more in the sixth line.

+15
source
+3
source

Source: https://habr.com/ru/post/901291/


All Articles