Fitting datatable in window widget to screen size

Hi,
I have a pop window with a datatable, pager and a button what I want to do is set the postion of pager and button at the bottom the window and the datatable should use the remaining space of the window.

However if data in datatable is too much the only the datatable should scrolling instead of whole content of window. I tried different ways but unable to achieve the functionality.

Sample snippet

  1. use position instead of css
  2. do not use autoheight to datatable
    Code Snippet