Datatable: Overall width and height dynamic

In the data table component I have specified the width and height of complete data table so that in case of large data set I get the scroller around. I my case dataset is dynamic according to some input. Now I want that i case the data set is small (smaller enough that cell couldn’t cover the specified cell height and width) than data table should adjust itself according to that size removing scroll er from that.