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

Layout a flex box similar to a table?

$
0
0

I'm working with a framework developed in-house which depends on a certain structure to our HTML. And one of the tricky things is that each row needs its own container with its own classes and data attributes.

So here's the problem. Without drastically changing the DOM, how can I make the flex box below render essentially like an HTML table would? Or is a table the only way? The solution will have to work in both IE11 and Chrome.

I'm trying to make it look like this...

Column A      |      Column B      |      Column C1             |      2             |      3

section {  display: flex;  flex-wrap: wrap;}section .col {  flex: 1 1 auto;}section .line-break {  flex-basis: 100%;  width: 0px;   height: 0px;   overflow: hidden;}
<html><head></head><body><section><header><div class="col">Column A</div><div class="col">Column B</div><div class="col">Column C</div></header><div class="line-break"></div><div class="row"><div class="col">1</div><div class="col">2</div><div class="col">3</div></div></section></body></html>

Viewing all articles
Browse latest Browse all 1323

Trending Articles



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