Skip to content

[css-tables-3] Editorial: clarification for "Columns whose size is computed as a sum..." #1688

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

Closed
davidsgrogan opened this issue Aug 3, 2017 · 5 comments
Assignees
Labels
css-tables-3 Current Work

Comments

@davidsgrogan
Copy link
Member

https://drafts.csswg.org/css-tables-3/#width-distribution-in-fixed-mode says

Columns whose size is computed as a sum of a percentage and a pixel length must be sized as if they counted as two columns, one with the pixel value, the other with the percentage value.

What does this mean and how is it different from auto width distribution? Is "computed as a sum" referring to columns that have width specified as calc()?

@fantasai fantasai added the css-tables-3 Current Work label Aug 15, 2017
@FremyCompany
Copy link
Contributor

This was indeed a text added after we resolved that width: calc(50% + 50px) should work in fixed mode on columns.

@FremyCompany FremyCompany self-assigned this Aug 30, 2017
@davidsgrogan
Copy link
Member Author

Are you sure that was the resolution? Maybe I'm looking in the wrong place but I found these:
#94
https://log.csswg.org/irc.w3.org/css/2016-07-27/#e708168

Then the end of https://drafts.csswg.org/css-values/#calc-computed-value says mix-unit calc expressions in table parts may be treated as auto.

I guess the part of the spec I quoted up top is defining the behavior for implementations that don't treat them as auto.

And from the sizing-type definition in https://drafts.csswg.org/css-tables-3/#width-distribution-algorithm, I see that calc values would fall under the auto-column definition, so maybe that answers my question about how is this different than auto width distribution: auto tables treat calc widths as auto and fixed tables can treat them as auto or resolve them against the table width?

@FremyCompany
Copy link
Contributor

Well, no, you cannot resolve percentage away because they do weird things when the table is constrained, even in fixed mode.

I agree that the spec text here does not map to what the resolution says, I'll maybe remove it (or, rather, mention that a browser MAY decide to interpret calc that way, but are not required to do so; if they don't they are however required to treat them as auto like in non-fixed table layout mode)

@FremyCompany
Copy link
Contributor

A browser supporting the calc would display the two tables of https://wptest.center/#/q1juv4 the same (well, maybe with a 1px difference due to the missing border)

@davidsgrogan
Copy link
Member Author

I think the last rule in https://wptest.center/#/q1juv4 should be td:nth-child(3) instead of td:nth-child(2). With that, Chrome/FF/Edge display the tables the same. But I think this adaptation shows what you mean https://jsfiddle.net/dgrogan/uk4h5u8p/
(differences are nth-child(3) and s/100px/20px/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-tables-3 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants