I am trying to make a table using flexboxes that is also absolutely positioned.
Each row is a standard div with display: flex
Each item in each row is the flexed item.
Note that there is no width set anywhere.
Why are my background colors so messed up.
I noticed that the background extends farther if there is more text in the rows and that the position is calculated from the background which is fine except that the background does not include the whole row.
Tried display: inline-flex
and background-size: cover
to no avail
https://jsfiddle.net/66f9s2kp/7/
<div style="z-index: 3; position: absolute; top: 50px; left: 50%; transform: translateX(-50%);">
<div style="display: flex; background-color: rgb(173, 216, 230);">
<div style="flex: 0 0 200px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: left; white-space: nowrap;">tesdfxt stuff</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">more</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">29</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">Standard</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
</div>
<div style="display: flex; background-color: rgb(173, 216, 100);">
<div style="flex: 0 0 200px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: left; white-space: nowrap;">tesdfxt stuff</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">more</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">29</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">Standard</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
</div>
<div style="display: flex; background-color: rgb(173, 216, 230);">
<div style="flex: 0 0 200px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: left; white-space: nowrap;">sume stufff</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">more</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">29</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">Standard</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
</div>
</div>
<div style="z-index: 3; position: absolute; top: 150px; left: 50%; transform: translateX(-50%);">
<div style="display: flex; background-color: rgb(173, 216, 230);">
<div style="flex: 0 0 200px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: left; white-space: nowrap;">tesdfxt stuff</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">more</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">29</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">Standard</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
</div>
<div style="display: flex; background-color: rgb(173, 216, 100);">
<div style="flex: 0 0 200px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: left; white-space: nowrap;">tesdfxt stuff</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">more</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">29</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">Standard</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
</div>
<div style="display: flex; background-color: rgb(173, 216, 230);">
<div style="flex: 0 0 200px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: left; white-space: nowrap;">so much stuff tipsois asdfasdfasdfasdfasdfasdfthinggyh stuff</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">more</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">29</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">Standard</div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 100px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;"></div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
<div style="flex: 0 0 75px; font-family: monospace; background-color: transparent; border: 1px solid black; overflow: hidden; text-align: center; white-space: nowrap;">0</div>
</div>
</div>
Help, for my sanity,
Thanks,
Ryan