我一直在寻找改变 DataGrid 上页脚高度的方法,但没有成功。我希望有一个像 headerHeight 这样的简单解决方案,但它似乎不存在。我在文档中的搜索是疯狂的或盲目的。谢谢你。
试试这个,它应该有助于覆盖页脚的高度:
sx={{
// This is to override the default height of the footer row
'& .MuiDataGrid-footerContainer': {
height: '40px',
minHeight: '40px',
},
}}
完整组件代码:
<DataGrid
rows={data}
columns={columns}
sx={{
// This is to override the default height of the footer row
'& .MuiDataGrid-footerContainer': {
height: '40px',
minHeight: '40px',
},
}}
/>