Better scrolling and layout for grids.

Fixed layout bug causing the horizontal scrollbar in related tables to overlap the last row.

Closes #208