[css-flexbox][css-sizing] Using tables in flexbox #948
Labels
Closed Accepted by CSSWG Resolution
css-flexbox-1
Current Work
css-sizing-3
Current Work
Tracked in DoC
Milestone
https://drafts.csswg.org/css-flexbox-1/#valdef-display-flex
https://drafts.csswg.org/css-flexbox-1/#propdef-flex
https://drafts.csswg.org/css-flexbox-1/#propdef-flex-wrap
https://drafts.csswg.org/css-sizing-3/#valdef-width-fill
If you have items in a flex-box, want them be all the same size and flex up and down as long as they don't get smaller than their min-content, and wrap the flexbox otherwise, this is generally very easy:
However, due to the way
width: auto
works on tables, if one of the items is a table, it doesn't work. I believe it's expected (although I am not 100% convinced it is[1]), but if so we need a way to opt into it.As I understand,
width: fill
is meant to do on anything whatwidth: auto
does on blocks, so this ought to work:However, in all current browsers that implement
fill
(or a prefixed version of it), it does not. Firefox, Chrome and Safari all do different things, but none fully do what I expect.Here's a little demo: http://output.jsbin.com/diziga/
Leaving bugs aside, it seems all browsers agree that
width: fill
should takes the full width of the flex container.Reading the spec, it does not seem to call for the behavior that I expect, but then again the definition is somewhat convoluted, so I may be missing something.
Is this a problem with my understanding of what
width:fill
is supposed to do (and if yes, how is this problem supposed to be solved)?Is the spec failing to define
width: fill
the way it should?Are these just bugs in implementations?
[1] Looking at the jsbin example above, Firefox/Edge vs Blink/Webkit also have a different rendering of the table {width: auto} case, but the difference is smaller. I wonder which one is spec compliant, if any. I'm happy to submit a ref test if someone more familiar with the flex algo can clarify.
The text was updated successfully, but these errors were encountered: