Layout
The Data Grid offers multiple options to control its layout.
Height
Fixed Height
You can specify a fixed height using CSS or the sx
prop:
Auto Height
The Data Grid can automatically adjust its height to fit the content
by using the autoHeight prop:
Width
Fluid Width
By default, the Data Grid takes the full width of its container. The
columns flex to fill the available space.
Fixed Width
You can specify a fixed width using CSS or the sx
prop:
You can add pagination and adjust the page size using
initialState (here 5 rows per page):