Re: How do I make a HTML tree for a set of nodes?
| From: | Rafael | Date: | Sun, 04 Jun 2006 16:36:33 +0000 |
| Subject: | Re: How do I make a HTML tree for a set of nodes? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237350@lists.php.net to get a copy of this message | ||
Well, if you're asking for some recommendation on how to show it, I would suggest to use lists (either ordered -OL- or unordered -UL- depends on you), or maybe even data-lists (DL), so you would get
+- parent 1
| +- child 1
| \- child 2
+- parent 2
\- sub-parent1
+- sub-child 1
\- sub-child 2
into something like
<ul>
<li> parent 1
<ul>
<li>child 1</li>
<li>child 2</li>
</ul>
</li>
<li> parent 2
<ul>
<li> sub-parent 1
<ul>
<li>sub-child 1</li>
<li>sub-child 2</li>
</ul>
</li>
</ul>
</li>
</ul>
Now, if you're asking for code, send what you've tried so far, and maybe someone will be able to help you (either correcting your code, or sending another way to do it)
Niels wrote:
I have a set of nodes. Each node has a parent and so the set can be thought of as a tree. I want to show that tree somehow on a webpage, served by PHP. I cannot use Dot/Graphwiz for various reasons. What I'm looking for is an output of DIVs or tablecells, showing the nodes and their connections. It's not a trivial task, IMO, but doable. Possibly somebody has already made something similiar, but I can't find anything on Google. Can anybody point me to helpful information? -- Atentamente / Sincerely, J. Rafael Salazar Magaña