php - Split 3-tier menu into columns -


i have 3-tier menu system in there 3 levels such each top-level menu item has x mid-level items , each mid-level item has y bottom-level items.

for each top-level item need split mid-level , bottom-level items 3 columns equally possible restriction cannot split children of mid-level item 2+ columns. if didn't have keep children of mid-level item together, making equal columns pretty simple diving total number of children in top level item 3. however, since need group children of mid-level items, seems become less trivial.

for example - 3 columns of equal length:

| mid 1       | mid 2       | mid 3       | | -bottom 1-1 | -bottom 2-1 | -bottom 3-1 | | -bottom 1-2 | -bottom 2-2 | -bottom 3-2 | | -bottom 1-3 | -bottom 2-3 | -bottom 3-3 | | -bottom 1-4 | -bottom 2-4 | -bottom 3-4 | 

and 3 unequal columns:

| mid 1       | mid 2       | mid 4       | | -bottom 1-1 | -bottom 2-1 | -bottom 4-1 | | -bottom 1-2 | mid 3       | -bottom 4-2 | | -bottom 1-3 | -bottom 3-1 | -bottom 4-3 | | -bottom 1-4 | -bottom 3-1 |             | 

i'm not looking code, i'm looking idea on how approach conceptually.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -