V
V
Valera Programmer2015-03-12 12:25:34
Java
Valera Programmer, 2015-03-12 12:25:34

How to implement an algorithm for displaying a multi-level menu from a database?

there is a table:
1 0 "Home"
2 0 "News"
3 0 "About the company"
4 3 "Contacts"
5 3 "Affiliate program"
6 0 "Online support"
7 2 "Last month"
8 4 "Contacts of regions
" display it in ul li like this :
Home
News -----
Last month the output of this in ul li ps took the table off the head!) pps need an example in java, if it doesn't make it difficult for you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2015-03-12
@noddux

through a recursive function on the parent, which will check for the presence of children and display them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question