Can checkboxes be reflowed into columns horizontally as the container's height changes dynamically with an unknown number of checkboxes? Here is a visual representation to illustrate the concept:
Height = 180px (20px * 9 checkboxes):
[ ] Checkbox 1
[ ] Checkbox 2
[ ] Checkbox 3
[ ] Checkbox 4
[ ] Checkbox 5
[ ] Checkbox 6
[ ] Checkbox 7
[ ] Checkbox 8
[ ] Checkbox 9
Height = 140px (20px * 7 checkboxes):
[ ] Checkbox 1 [ ] Checkbox 8
[ ] Checkbox 2 [ ] Checkbox 9
[ ] Checkbox 3
[ ] Checkbox 4
[ ] Checkbox 5
[ ] Checkbox 6
[ ] Checkbox 7
Height = 100px (20px * 5 checkboxes):
[ ] Checkbox 1 [ ] Checkbox 6
[ ] Checkbox 2 [ ] Checkbox 7
[ ] Checkbox 3 [ ] Checkbox 8
[ ] Checkbox 4 [ ] Checkbox 9
[ ] Checkbox 5
As the height of the container element decreases, the checkboxes would automatically flow into new columns horizontally.
NOTE: I understand that I can achieve this programmatically, but I am curious if it can be done using only HTML and CSS.