Re: How do I make a HTML tree for a set of nodes?
| From: | tedd | Date: | Sun, 04 Jun 2006 13:30:25 +0000 |
| Subject: | Re: How do I make a HTML tree for a set of nodes? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237344@lists.php.net to get a copy of this message | ||
At 3:03 PM +0200 6/4/06, Niels wrote:
>On Sunday 04 June 2006 14:58, tedd wrote:
>
>> At 2:07 PM +0200 6/4/06, Niels wrote:
>>>Hi,
>>>
>>>
>>>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?
>>>
>>>Thanks,
>>>Niels
>>
>>
>> What, a binary-tree or linked-list sort of thing?
>>
>> tedd
>
>Not binary -- a node can have several children. Each node has an id and a
>parentId. The actual structure isn't important and can easily be objects,
>arrays-of-arrays or whatever is handy.
>
>//Niels
You can dynamically generate a table and place text (and/or color) the cells that are nodes -- that
would be my approach. You would need to know the width and depth of the tree and then just fill in
the cells that are nodes.
hth's
tedd
--
------------------------------------------------------------------------------------
http://sperling.com http://ancientstones.com http://earthstones.com