Multiple trees in a table

Explorer like navigation tree for websites
Navigationsbaum für Internet Auftritte.
Post Reply
Guest

Multiple trees in a table

Post by Guest »

Hi again,

I am so sorry for all these messages.
Can you tell me how I can put each individual tree into a table cell?

e.g.

Code: Select all

<table border="1" width="100%">
	<tr>
		<td>Tree 1</td>
		<td>Tree 2</td>
		<td>Tree 3</td>
	</tr>
</table>
(Splitted from the previous topic 'How to create multiple trees...' and given a new subject by Hans 2006-03-30)
User avatar
Hans
Site Admin
Posts: 77
Joined: 16 Dec 2005, 16:52
Location: Germany
Contact:

This topic might help others, so thank you.

Post by Hans »

Hello,

no problem for your question.
To include multiple trees in a table you are recommended to restructure the menu-file, because the table should be defined in the html part of the document-body and not in the javascript-section for the trees. Each tree is shown (written into the document) using the command 'document.write(tree);' as explained in the help 'TreeMenu -> First steps -> Show menu'.

To use two trees (named treeA and treeB) in a table you might code in your menu-file, e.g. 'menu_eng.html':

Code: Select all

<html>
...
<body>
<script type="text/javascript">
<!--
   treeA = new treemenu('treeA',...);        // First tree: 
   treeA.put(...);                           //   Instantiate and fill the tree
   treeA.add(...);                           //   with 'add/put' but don't type
   ...                                       //   document.write(treeA);
   treeB = new treemenu('treeB',...);        // Second tree: 
   treeB.put(...);                           //   Instantiate and fill the tree
   treeB.add(...);                           //   with 'add/put' but don't type
   ...                                       //   document.write(treeB);
//-->                                        

<!-- Beginning of the HTML-part in the document body -->
<table>
  <tr><td>
     <script type="text/javascript">
     <!--
     document.write(treeA);                  // Include the first tree 'treeA'
     //--> 
  </td><td>
     <script type="text/javascript">
     <!--
     document.write(treeB);                  // Include the second tree 'treeB'
     //-->                                   
  </td></tr>
</table>
</body></html>
With this concept you are able to include multiple trees anywhere in any html-document. I hope this helps and I would be happy to hear your operating experience.

Further and in-depth informations concerning general html or javascript can be obtained from e.g. http://www.selfhtml.org.

Thanks again for using TreeMenu.
Hans
Your forum admin
nicolas1388
Posts: 2
Joined: 16 Jun 2006, 00:49
Location: Germany

2 Treemenus in table 2 colums

Post by nicolas1388 »

Hi!
I did follow you advise to place the 2 tree menus in 2 colums.
Unfortunately I got the connecting lines / icons / menu description below eachother and not on the same line.
It seams to be related to the format between table and tree because once I remove the two colums table, I recover the standard tree with connecting lines / icons / menu description on the same line as usual....

I struggle to understand why.... :cry:

Thanks
User avatar
Hans
Site Admin
Posts: 77
Joined: 16 Dec 2005, 16:52
Location: Germany
Contact:

Table problem

Post by Hans »

Hi 'nicolas1388',

could you please try to predefine the widths of the table cells using html-commands like

Code: Select all

<table style="width:95%">
  <colgroup><col style="width:50%"><col style="width:50%"></colgroup>
   ... table content ...
</table>
As i realized by my own, some browsers handle table widths different, e.g. some versions of opera calculate cell-widths too small, resulting in early wrapping the lines - even of treemenu. Could you also check your tree-page using different browsers?

I'd be happy to hear your results. If your problems persist, you also might send me your files.

I hope my explanations helped you to further use TreeMenu.
Thanks
Hans Bauer
Your forum admin
nicolas1388
Posts: 2
Joined: 16 Jun 2006, 00:49
Location: Germany

Table problem

Post by nicolas1388 »

Hallo,

I have tried your propositions but it does not work properly....
The connection / symbol / link are on separate lines independently from the option I give the the html table tag option....

I don't know how we should proceed to come further?
If you put two trees in a table on the same document, you should see what I mean, if not I could send you my files....
Thanks!
User avatar
Hans
Site Admin
Posts: 77
Joined: 16 Dec 2005, 16:52
Location: Germany
Contact:

How to proceed

Post by Hans »

Dear 'nicolas1388',

i already included two trees in a table without the menu-lines beeing splitted as you mentioned - see above.

Could you please send me your (cleaned-up?) files: index.html + menu-file(s) + subdirectories /css and /js + other necessary files depending on your configuration. I also ask you to describe me what to do (what browser do you use, what's your screen-resolution,...) to see the splitted menu-lines you mean. I will then try to find the fault.

Thanks
Hans Bauer
Your forum admin
Post Reply