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

Prevent div to grow in flex mode

$
0
0

I have read a lot of posts facing this issue, and no solution works for me. The problem is very simple. Here is an overview of the structure:

<div id=mainDiv><div id=banner></div><div id=expectedDivWithScrollBar><table> Very height table </table></div></div>

I have expectedDivWithScrollBar that takes the remaining height available (under a banner) of the viewport with:

display:flex;flex: 1 0 auto;

Now, in this div, I have a table that can become bigger than the div.I would like to have a scrollbar in that div, and NOT in the main div, because I don't want scroll the banner.

Without the table, the dimension of expectedDivWithScrollBar are perfect, automatically computed.

I though that adding "overflow: auto" in expectedDivWithScrollBar would have solve the issue, but it has no effect. flew-shrink to 0 doesn't work as well.

All the solutions I saw seems to rely on setting a size on expectedDivWithScrollBar (Or one of his parents), but that's not acceptable. Everything is dynamically sized...

Thanks for your help!


Viewing all articles
Browse latest Browse all 1675

Trending Articles



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