April 4, 2012

Need to automate de creation of a html Family Tree

Question by Daniel Novais

I need do automate (is that a word?) the creation of a Family Tree in html. I don’t have many knowledge of this language, so I need a simple code (or guidelines to it) that allows me to create a simple family tree. Just the basic stuff like a box for the Name and DOB of a person and a arrow pointing to its relatives (children, parents and brothers).

Answer by Starx

As the term automate is used here. I suppose you are trying to create the HTML elements without actually having it in the HTML page. So, here is a way you can create a HTML and the tree structure subsequently.

var div = $("<div />")
div.append("<div id='another' />")
div.append("<div id='next' />")
div.appendTo($('body'));

This create a div, puts two other div inside it, and is appended in the body tag.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!