Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why there is no tree tag in html?

Tags:

html

tree

tags

I wonder why there is no tree tag in html? Something like table tag.

For example:

<tree>
  <treenode id=root>
    <treenode id=child1 />
    <treenode id=child2>
       <treenode id=child2-1>
       ......
       </treenode>
    </treenode>
  </treenode>
</tree>

Edit: well actually I did not get a clear answer to this question. I think this was not a valid question. But putting the answer from cherouvim beside comment from Anwar Chandra together, I think I've got the answer to my question.

like image 342
zardosht Avatar asked Dec 10 '09 17:12

zardosht


1 Answers

There is. Nested lists (ul, or ol).

<ul>
    <li>foo</li>
    <li>bar</li>
    <li>test
        <ul>
            <li>foo</li>
            <li>bar</li>
        </ul>
    </li>
    <li>example</li>
</ul>

And with the help of CSS and JS you can make the tree look and interact like, for example, the windows explorer.

like image 58
cherouvim Avatar answered Sep 21 '22 02:09

cherouvim