scrolling page based on focus of elements?

scrolling page based on focus of elements?

I am creating a plugin that gives keyboard navigation to tabular table across multiple tables.
When I have rows that run off screen I would like to scroll the window down.. and the reverse is true, when navigating up.
 
Logically I need to get the position of the element that has focus and specify how much to scroll the window.  Any help in this direction would be great!!
 
Thanks!