For example, I might have 200 records. If the screen is, say 1024 * 768, maybe 10 records would fit, but if the screen is a 4K screen, it can probably fit 40 records on a page.

For further context, it will then loop through the records every (say) 30 seconds. I know how to do that part, I'm just not sure how to have it show the most records that can fit without scrolling based on the screen resolution. It would be similar to a single screen departures board at an airport where it loops through the departures on one screen instead of being spread across multiple screens. The main difference is that I don't have control over the screen size, and it needs to work for whatever screen size it is put on, automatically fitting in the maximum number of records possible per page.