0

I need help with a dynamic layout in html. I need it to work as divs but could only set it up with tables.

Basically it's a tree strucutre and as child nodes are added there are child tables created which creates the layout of the nodes I want.

Also does anyone have a clever idea for connecting a line from the parent to the child nodes without using canvas?

Basically it's a mindmap

Here is the html You can see the layout with the html here http://jsfiddle.net/Z6jcD/

<table border="0">
        <tbody>
            <tr>
                <td>
                    <div class="divnodes" contenteditable="true" id="0">
                        <h4 class="marketing-header">Root</h4>
                    </div>
                </td>

                <td>
                    <table border="0">
                        <tbody>
                            <tr>
                                <td>
                                    <div class="divnodes" contenteditable=
                                    "true" id="1">
                                        <p style="font-weight: bold">Grand
                                        mother_</p>
                                    </div>
                                </td>

                                <td></td>
                            </tr>
                        </tbody>
                    </table>

                    <table border="0">
                        <tbody>
                            <tr>
                                <td>
                                    <div class="divnodes" contenteditable=
                                    "true" id="2">
                                        Grand father_
                                    </div>
                                </td>

                                <td>
                                    <table border="0">
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <div class="divnodes"
                                                    contenteditable="true" id=
                                                    "3">
                                                        <p style=
                                                        "font-weight: bold">
                                                        Mother_</p>
                                                    </div>
                                                </td>

                                                <td></td>
                                            </tr>
                                        </tbody>
                                    </table>

                                    <table border="0">
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <div class="divnodes"
                                                    contenteditable="true" id=
                                                    "4">
                                                        Father_
                                                    </div>
                                                </td>

                                                <td></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
5
  • Do you want a tree structure or a mind map? A mind map is a kind of spider diagram, not a tree structure. Commented Jun 10, 2014 at 20:53
  • Good question nick, its more of a mindmap for the base version i'm happy for it to just be a hierarchy going from left to right Commented Jun 10, 2014 at 20:55
  • ___mother Root<___Father This kind of thing Commented Jun 10, 2014 at 20:57
  • something like this http://stackoverflow.com/a/18434881/2359055 Commented Jun 10, 2014 at 21:59
  • @AbrahamUribe actually yes that is very very close! Commented Jun 10, 2014 at 22:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.