38 ms·
> second field stretching If you want the second column to stretch, then the `fr` part is assigned to the second column. Mixing `fr` and `auto` doesn't really
by recursive 2y ago
> second field stretching
If you want the second column to stretch, then the `fr` part is assigned to the second column. Mixing `fr` and `auto` doesn't really make sense. You can do it like this. https://codepen.io/tomtheisen/pen/emOeqPy https://codepen.io/tomtheisen/pen/emOeqPy
grid-template-columns: 10em 1fr;
- dylan604 2y agobut i don't know if 10em is too much or too small. that's the point. i don't want a specific width defined
- robertoandred 2y agoTry min-content, fit-content, or max-content instead of auto.
- dylan604 2y agoThis is probably the way. I also have issue of letting go and fully accepting the way of the flex. Instead of feeling comfortable just throwing elements inside the grid element, by brain needs each row to have a wrapper element like a tr and nested td instead of just tossing td elements in tbody (sticking to the table mentality). It took a minute for me to get that to click in my head for whatever reason
- recursive 2y agoThen you can use 1fr 10fr or any ratio you want.
- dylan604 2y agothe any ratio I want is the point of the exercise. i don't know how many or what size. i want the first column to be just wide enough, and the second column to fill the space. what you suggested does not do that, but thanks for playing
- recursive 2y agoYou're welcome. Now that you've explained the rest of your requirements, I can see that `fr` is not suitable for the purpose. In the meantime you've gotten a better answer for the updated requirements, in particular min-content and max-content.
- dylan604 2y agoThe requirements have not changed.
- recursive 2y agoMaybe not, but the way they were described has. First: > I want a simple 2 column row with the first field being narrow and the second field stretching to fill the width Second: > i want the first column to be just wide enough, and the second column to fill the space.