Change table behaviour


I use customlayouts for my application and I have pages with tables.

I want to paging the table, so I set table.setPageLenght(20) and table.setSizeFull();

In this way the table height is calculated as nrows x rowheight, but I want to set table height to 100% free space in its div.

This because my footer now overlap the table (I tried some way but no positive results), but I want a auto-resizeable table.
So the result I would is that if there is no more space and something push up the table, the table resize itself showing less rows.

How can I achieve this?

So, I would have the expandratio behaviour in the CustomLayout.