Can any one tell me how can I identify rows in a webtable based on "id" attribute of TBODY tag of table.

I have a table with multiple tbody tags in it and each tbody has unique id attribute. I need to get the rows of the table based on this id value.

In other words, , during run time when I access a row of the table, how can I know the id value of the TBody to which it (this row) belongs to.
More over I need to know number of rows in each Tbody section.