After spending far too much time at work today pondering this issue, I've decided to turn to the collective wisdom of the internet.
My dilemma involves a standard <ul>
containing multiple <li>
elements (currently 12, but this number could vary). I am seeking a way to organize these into 2 columns of equal width without causing the <ul>
to take up the entire block width. Additionally, any solution must be compatible with IE11 and be responsive, meaning no fixed percentage widths. Here are a couple of scenarios that I have tried:
Solution 1 (grid):
The above solution works quite well - it arranges the <li>
s into 2 columns within a centered <ul>
in a flex container. However, issues arise with IE compatibility and the need to manually assign position values for each <li>
, which is impossible with variable list lengths.
Solution 2 (flex):
This alternative solution functions adequately and offers IE11 support, but it lacks visual appeal due to the <ul>
extending across the full width, leaving excessive white space on the right side of each column on wide screens.
Solution 3 (tables for IE11):
I experimented with targeting IE11 specifically using table display properties, but the resulting layout was visually unpleasing and cumbersome to implement.
Should I settle for Solution 2, or is there a way to achieve the desired visual layout of Solution 1? Any suggestions would be greatly appreciated!