Not quite sure how to word this question. What I'm trying to do is allow for a layout where there is a label/data pair stacked in columns. So markup might be:
<div>
<div class="label">hello</div>
<div class="data">world</div>
<div>
And I want multiples of those in equal width columns so I use flexbox and end up with something like this:
hello hello hello
world world world
This gives me a nice visual with easy accessibility as the label/pairs are read together in markup flow.
Works fine. Now, the snag: the labels can get quite long. So I end up with something like this:
hello hello this hello
is a really
world long label world
world
And what I really want is this:
hello hello this hello
is a really
long label
world world world
Is this doable with flexbox? I attempted to come up with something but it's not quite there:
My gut says no, this can't be done, because each individual row in each column has no understanding of the height of the rows in an adjacent column. But as I'm surprised with each new bit of flexbox I learn, I thought I'd ask.
I realize I could make this work by putting all the labels in one row of columns, and all the data in a separate row of columns, and then perhaps use some ARIA attributes to tie them together for accessibility. Perhaps that's the best solution?