create function for dynamically setting table scroll heights