DataTable autofit vertical

Is there a way to get DataTable to take up only as much vertical space as it needs, up to (say) some maximum size?
I tend to have these spaces below DataTables when the vertical size is more than is needed for the
number of rows it happens to be showing. I can adjust the size of course depending on the number of rows but I’m wondering if there is some combination of sizing_mode or something that would do it automatically.

I don’t know if you can make it automatic - it doesn’t seem like it after a brief glance at the source code.
But there’s the height property that’s set to 400 by default. Maybe you could use that. There’s also row_height property (25 by default), so you could roughly compute the height and set it yourself.

Hi thanks. Yeah that’s what I’ve concluded also.