I have a layout problem and I'm having trouble thinking of a solution.
This is part of a form and basically its a dynamic list of checkboxes and their labels. Based on the screen width its either in 1, 2, or 3 columns.
We're arranging in columns, like for 3 columns:
1 5 9
2 6 10
3 7
4 8
If they were static this would be easy to do with css columns... but the challenge is that these are part of a treeview where each item can expand to show more items:
With CSS columns (or flexbox columns with a set height) if you expand, say, "2017" it will push the dates below it into the next column which I believe would be confusing for the end user. So ideally when 2017 is expanded, it would push everything below it down instead of into the next column.
This can be almost achieved by using flexbox and flex-wrap... but the only issue is the order.
So I basically want flexbox rows functionality with ordering like columns. I'm not great at math so I was wondering if there's something that can be done purely with CSS... but otherwise I am open to javascript solutions as well, though it needs to be accessible.
And ideas? Thanks.