[css-tables-3] Max-width On Table Cells · Issue #2802 - GitHub
- Notifications You must be signed in to change notification settings
- Fork 678
- Star 4.5k
- Code
- Issues 3.5k
- Pull requests 95
- Actions
- Projects 8
- Security
- Insights
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Sign up for GitHubBy 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
Jump to bottom [css-tables-3] max-width on table cells #2802 Open fantasai opened this issue Jun 21, 2018 · 9 comments Open [css-tables-3] max-width on table cells #2802 fantasai opened this issue Jun 21, 2018 · 9 comments Assignees Labels css-tables-3 Current WorkComments
Copy link Collaboratorfantasai commented Jun 21, 2018
In #1643 (comment) @davidsgrogan wrote:
I haven't looked into this in detail, so I might be missing something, but results of the test appear to contradict the css-tables-3 spec where it says
so filing this issue for further investigation by the css-tables-3 editors~ |
The text was updated successfully, but these errors were encountered: |
dbaron commented Jun 26, 2018
I think what's happening here is that the contents of the cell overflow the cell, which is fine. However, it doesn't violate the principle that the cells are always the same block-size/inline-size as their row/column, and the rows/columns (modulo border-spacing) cover the entire table and don't overlap. |
Sorry, something went wrong.
FremyCompany self-assigned this Jun 26, 2018 Copy link ContributorFremyCompany commented Jun 26, 2018
Yes, I don't disagree that this is what is meant, but I think @fantasai is right, and currently the spec doesn't cap the max width by 'max-width' correctly, not sure where that math got inherited from but it doesn't appear to be accurate. https://jsfiddle.net/9uduq99L/15/ shows that the math should have the min-content-width be in the clamp with max-width as a cap, and width should be clamped too instead of min-ed because max-width isn't used as a minimum value, just as a maximum for the other values. I think the statements were orginating from the time where max-width didn't exist because width isn't allowed to make the cell smaller than its minimum width, it looks like the max-width thing is very likely to be a bug that stuck. I'll update the spec accordingly. |
Sorry, something went wrong.
Copy link Memberdavidsgrogan commented Aug 21, 2018 • edited Loading
I have also not looked into this too deeply, but the cell in the example from the first post isn't constrained according to the definition, which doesn't consider non-auto max-width to be constraining:
I don't know if that's intended, an entirely separate issue, or a separate issue that's affecting this one. But the first post quoted max-content width of a table-cell in a **constrained** column is... which doesn't seem to apply here. |
Sorry, something went wrong.
davidsgrogan mentioned this issue Aug 21, 2018 [css-tables] column constrainedness and cell outer max-content width #3037 Open Copy link Memberdavidsgrogan commented Aug 22, 2018 • edited Loading
Actually, @FremyCompany, could you write your math in the above comment more formally -- as in just max(a, min(b, c, d)) etc? I don't follow the prose too well. It's relevant to https://crbug.com/860084, which discusses how http://jsfiddle.net/dgrogan/hbtm85uk/9/ renders differently in Edge, FF, and Chrome. Edge/Chrome agree on the table width but don't agree on column width distribution. If you force FF to have Edge/Chrome's table width, then it agrees with Chrome on distribution. I'm trying to sort through all that. |
Sorry, something went wrong.
Copy link Memberdavidsgrogan commented Jul 20, 2019
I think the correct formula for outer max-content width of a table-cell in a non-constrained column is the existing formula with width and min-content width removed: max(min-width, min(max-width, max-content width)) |
Sorry, something went wrong.
Copy link Memberdavidsgrogan commented Jul 20, 2019
Blink and FF do different things either for outer max-content width of a table-cell in a constrained column, or for max-content width of a column based on cells of span up to 1. In one of those places, FF lets a specified width on one cell override the max-content width of a different cell in the same column. FF makes below table 75px wide. Chrome makes it 100px. (Akin to first blue table in https://jsfiddle.net/dgrogan/9uduq99L/19/) <table> <tr><td style="width:75px;"></td></tr> <tr><td> <span style="display: inline-block; width: 50px;"></span><span style="display: inline-block; width: 50px;"></span> </td></tr> </table>I think chrome's makes more sense in isolation, because it's easy to remember that width is just another min-width for tables. But combined with the width distribution algorithm, it makes http://jsfiddle.net/dgrogan/hbtm85uk/9/ act in a way I consider weird in chrome and more sensical in FF. |
Sorry, something went wrong.
Copy link Memberdbaron commented Jul 20, 2019
Based on memory (didn't check), I believe the Firefox behavior matches IE6... and I would suspect Edge as well. |
Sorry, something went wrong.
Copy link ContributorFremyCompany commented Jul 20, 2019
I just ran the test case in Chrome vs EdgeHTML, and they seem to match. |
Sorry, something went wrong.
Copy link ContributorFremyCompany commented Jul 20, 2019
(The only difference above is the fact Edge doesn't support the max-content keyword) |
Sorry, something went wrong.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment AssigneesFremyCompany
Labels css-tables-3 Current Work Projects None yet Milestone No milestone DevelopmentNo branches or pull requests
4 participants You can’t perform that action at this time.Từ khóa » Html Col Max Width
-
How Can I Limit Table Column Width? - Stack Overflow
-
CSS Max-width Property - W3Schools
-
CSS Column-width Property - W3Schools
-
Max-width - CSS: Cascading Style Sheets - MDN Web Docs
-
Column-width - CSS: Cascading Style Sheets - MDN Web Docs
-
How To Set Fixed Width For
In A Table ? - GeeksforGeeks Max-width · WebPlatform Docs
Html – Table Columns, Setting Both Min And Max Width With Css
Grid System - Bootstrap
Column-width - CSS-Tricks
Stop Using To Set Table Width In HTML: Here's Why »
Max-Width - Tailwind CSS
Sizing - Bootstrap
Centering Your Website Using Max Width And Auto Margins
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu