Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1318

Flex: 1 and Wrap not working inside grid? [duplicate]

$
0
0

I was trying to make container inside grid cell span to fill rest of space and let items inside wrap as needed but its expanding my table instead of behaving like it would behave outside the table. Any idea how to achieve it and why it happens?

Inside table:

<div style="display: grid; grid-template-columns: max-content auto;"><div style="display: flex; width: 100%; background-color: gray;"><div>  asdasd</div><div style="display: flex; flex: 1; background-color: blue; gap: 4px; padding: 4px; flex-wrap: wrap;"><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div></div></div></div>

Outside table:

<div style="display: flex; width: 100%; background-color: gray;"><div>  asdasd</div><div style="display: flex; flex: 1; background-color: blue; gap: 4px; padding: 4px; flex-wrap: wrap;"><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div><div style="background-color: green; width: 100px;">A</div></div></div>

https://jsfiddle.net/hvp14u5b/7/


Viewing all articles
Browse latest Browse all 1318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>