Hiding and element does not remove it, therefore as far as CSS is concerned, the element is still there and should still be counted for the purposes of nth-child
.
My suggestion would be to clone the table to act as a "template". Then, when changing the displayed rows, create a clone from this "template" and remove the rows from it that should not be shown. Then, you can fade out the displayed table, and fade in the new one.