General:
How can I select the first matching ancestor of an element in jQuery?
Example:
Take this HTML block
I prefer using closest as @Kobi points out (+1) as it seems to be the most concise way to do that. Just to point out, you can also use parents:
closest
$(this).parents("tr:first")