Skip to content
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

Table cell styling not working in MRT v3 #1295

Open
1 task done
evitalv opened this issue Nov 11, 2024 · 2 comments
Open
1 task done

Table cell styling not working in MRT v3 #1295

evitalv opened this issue Nov 11, 2024 · 2 comments

Comments

@evitalv
Copy link

evitalv commented Nov 11, 2024

material-react-table version

v3.0.1

react & react-dom versions

v18.3.1

Describe the bug and the steps to reproduce it

This code worked fine in v2. I was styling the table like this:
muiTableHeadCellProps: { sx: { fontWeight: 'normal', fontSize: '0.75rem', color: 'grey.600', textTransform: 'uppercase', }, }, muiTableBodyCellProps: { sx: { borderWidth: 0 }, },

And I was using the same properties for a couple of individual columns to change their alignment:
muiTableHeadCellProps: { align: 'center' }, muiTableBodyCellProps: { align: 'right' },

As I said, this works fine. The problem appears when I move the first part under the defaultColumn option, as is recommended in the migration guide. The result is that the default column styling is ignored for those columns that have the specific alignment.

Minimal, Reproducible Example - (Optional, but Recommended)

Please see above.

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not know how

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@itshallrun
Copy link

Please create a reproducable example in a stackbiz or opensandbox. You can use the basic sandbox and adjust it to reproduce the issue:
https://stackblitz.com/github/KevinVandy/material-react-table/tree/v3/apps/material-react-table-docs/examples/basic/sandbox?file=src%2FTS.tsx

@evitalv
Copy link
Author

evitalv commented Nov 15, 2024

Here you go: https://codesandbox.io/p/sandbox/vclgmw

You can see that the default formatting is ignored for column "Last name".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants