I'm struggling to figure out where to begin with this problem. My goal is to create a three-column row that can wrap below each other if they cannot fit horizontally. The height of the row should adjust to accommodate the items while maintaining a fixed height when all cells are in line. If the row is too large for the contents, the cells should be centered vertically. Here is an example layout:
[ ] [ Big ] [ ]
[ Content1 ] [ ] [ Content2 ]
[ ] [ Content ] [ ]
The layout should then wrap as follows:
[ ] [ Big ]
[ Content1 ] [ ]
[ ] [ Content ]
[ Content2 ]
And finally:
[ Content1 ]
[ Big ]
[ ]
[ Content ]
[ Content2 ]
I am having trouble determining how to adjust the height of the cells based on their content and the content of their neighbors. One idea I have is to use JavaScript to check the offsetHeight to see if they are on the same "row" and adjust the height accordingly, but it feels cumbersome. Do you have any better suggestions?
Thank you!