-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datatable: scrollable property loses column alignment #3091
Comments
Hi, Regards |
Simple workaround for this issue is to set min width for every column. |
Excellent workaround @ubau ! https://codesandbox.io/s/thirsty-austin-9jo7hu?file=/src/App.js |
@melloware That is a workaround for the with style issue, but not for the main ticket issue, because if I set some harcoded min-width for the columns, but then some cells have a bigger lenght the columns are getting messy anyway. |
I don't work for PrimeTek. I assigned it to Mert who is in charge of this project for PrimeTek. |
Well, this is just a workaround and issue still remains. |
Looks like this is a duplicate this person had the same issues and I commented with solutions and screenshots: #2951 |
If this styles are removed from the row This from the header And this styles are removed from the cells The bug is completely and beautifully gone. It can be localy fixed by overwriting the styles with .p-datatable-scrollable .p-datatable-thead > tr,
.p-datatable-scrollable .p-datatable-tbody > tr,
.p-datatable-scrollable .p-datatable-tfoot > tr {
display: table-row !important;
}
.p-datatable-scrollable .p-datatable-thead > tr > th,
.p-datatable-scrollable .p-datatable-tbody > tr > td,
.p-datatable-scrollable .p-datatable-tfoot > tr > td {
display: table-cell !important;
}
.p-datatable-scrollable .p-datatable-thead,
.p-datatable-scrollable .p-datatable-tbody,
.p-datatable-scrollable .p-datatable-tfoot {
display: table-header-group !important;
} I confirm, the bug is gone. |
Confirmed this is fixed in 9.2.0 |
Describe the bug
This occurs just by adding the scrollable property when cell values are very different each others:
Just by removing the "scrollable" property:
Check the next sandbox:
Reproducer
https://codesandbox.io/embed/great-monad-pzyj6p?fontsize=14&hidenavigation=1&theme=dark
PrimeReact version
8.3.0
React version
18.x
Language
TypeScript
Build / Runtime
Next.js
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
Keep the column alignment.
The text was updated successfully, but these errors were encountered: