0

Suppose I have a straight-forward flex-box table. I want the columns to all have equal width, to expand to the width of the table. That is, if there are four columns, each column will be 25% of the total table width. I know how to do this.

Now suppose that I want to be able to mark an arbitrary column with a class .fit-to-content. Any column marked with this class will have its width set to the max width needed for the content in the column.

This Codepen is my initial attempt at doing this: https://codepen.io/anon/pen/eoJmMN

Notice that while the flex-box column marked as .fit-to-content does have its width set to its content width, the widths differ across rows. Is there someway with flex-box to have the column share the same width?

Suppose I do not know the width in advance (i.e. I cannot just set the width to 100px or so).

Daniel
  • 10,641
  • 12
  • 47
  • 85
sir_thursday
  • 5,270
  • 12
  • 64
  • 118
  • 1
    you can't *align* flex items in adjacent *flexboxes* - that is not possible... use tables or css grid – kukkuz Apr 03 '19 at 18:01
  • see the [discussion here](https://stackoverflow.com/questions/55272962/alignment-of-content-vertically-in-adjacent-flexbox-containers/55291645#55291645) to see what I mean, thank you! – kukkuz Apr 04 '19 at 03:22

0 Answers0