Hello,
When using the new datagrid element, there seems to be a default grid height even when the height is set to ‘auto’.
Is there a way to make it fit better if there are only one or two rows in the datagrid?
Appreciate your help!
Hello @sampannemans,
It’s a default configuration of AG-grid (the library we are using)
You can force the min-height yourself with two ways:
In both case, you can use this code
.ag-center-cols-viewport {
min-height: unset !important;
}
Thanks so much!
You’re right—AG-Grid does apply a default height even when set to ‘auto’. A quick fix is to manually set a smaller min-height using custom code, especially if your grid only has one or two rows. That way, it fits your content better and avoids the empty space. Hope this helps! ![]()
Yes, I added the custom code to unset the min-height. That works fine!
Thanks