Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Tables probably shouldn't default to fixed width #2374
I'm not sure if this is baked in to the style or part of the implementation where we use it, but using
Using a fixed width for the columns:
This table pretty much illustrates all of the problems mentioned above. However, with standard, flexible column widths it becomes more readable, more efficient and less broken
Yes, we can still try harder to make things in tables less wordy, but still a huge improvement
• it is faster. From mdn:
• it is particularly well suited to achieving very complex responsive behaviours. Two examples from maas:
• in a paginated or virtualised scroll table (as in maas), it ensures table columns don't change widths as new content replaces the initial content
To resolve all of the issues you mention, you just need to set widths on the
• use grid column classes (the quick and dirty approach)
Would any of these work for you? Or do you need a solution that doesn't require writing any css? If that's the case, maybe we can add a utility class or local docs css that overrides the table-layout property.
I appreciate you looking into this, and providing the rationale behind it. I do think however that most of those advantages are mostly for UI design, rather than readability of the content, particularly in a docs context where we are dealing with static content.
In addition, I've added a utility to override this:
This is so regardless of the default, you still have access to the other option for special cases.