I have an automatic nested list structure that looks like this
<ul>
<li>AAA</li>
<li>BBB
<ul>
<li>111
<ul>
<li>XXX</li>
</ul>
</li>
<li>222</li>
</ul>
</li>
<li>CCC</li>
...etc...
</ul>
I am looking to arrange the content in columns as shown below:
AAA 111 XXX
BBB 222
CCC
By using JQuery and some CSS techniques, I can easily create a navigation menu. For example, selecting BBB from the first column will display its children in the second column while hiding any other second-level ULs.
My challenge lies in styling the list to achieve the desired column layout for different depths. Adding tags to each UL or LI to indicate depth is one option. However, when attempting to use relative positioning to shift each column left, vertical gaps are created where entries were moved. Absolute positioning solves this issue but may not be the most elegant solution. Any suggestions for a better approach?