Right-click a table component and select the row first

I found this post which says how to use rowAtPoint(), but it doesn’t seem to account for scrolling. At the top of the table, the row index it returns is 1. If I scroll down and right click the top row that is now visible, it still returns 1.

So I suppose my new question is how to account for the fact that there are several rows that are not visible when I right click, since I have scrolled down?