How to groups table rows in html to manipulate them with jquery

I have an html table with many rows. I'm currently grouping several rows inside a div (I know this is ugly) and then show or hide the divs to show or hide the rows inside it. Is there a standard way to do this. Something like rowgroup or multiple tbody instead of this ugly div grouping?


Solution 1:

Use <tbody> tags for this

Solution 2:

Give them a class name that is consistent then you can do:

$('table td.classname')

To get the ones you want.