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

width: fit-content for tables is hard to override or customize #485

Open
foolip opened this issue Mar 28, 2024 · 3 comments
Open

width: fit-content for tables is hard to override or customize #485

foolip opened this issue Mar 28, 2024 · 3 comments

Comments

@foolip
Copy link

foolip commented Mar 28, 2024

I'm having trouble with this style:

:where(table) {
width: fit-content;

It makes my table much narrower than without this style, and I can't figure out how to override it to get the default table layout. What's the right way to effectively cancel this rule? I've tried table { width: initial !important } but no luck.

This changed in #394.

@argyleink
Copy link
Owner

yo!

no !important required to override a :where() selectors, you should be able to just set a new width value for your table and it's g2g 👍🏻 the clue that the change doesnt feel like it's taking effect, may mean the sizing issue is elsewhere.

you may also want to overwrite the max width on td, if you're looking to have a wider table:

table {
  width: auto;
}

td {
  max-inline-size: auto;
}

Maybe your table is in a grid or flexbox container and *-content is used and effecting the inline sizing of your table too?

@foolip
Copy link
Author

foolip commented Mar 28, 2024

Thanks for the pointers, I'll have to revert https://foolip.github.io/spec-reactions/ to before I hacked around the problem and see if your suggestions work.

@argyleink
Copy link
Owner

looks like your

table {
  width: 100%;
}

is workin great?

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