Forum Moderators: open

Message Too Old, No Replies

Family tree in semantic HTML

Could be fun!

         

Robin_reala

2:49 pm on Jul 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ideas? The obvious two that spring to mind are nested lists, or a heading structure. Both I assume are going to be relatively hard to style but I think I'd do better with the nested lists option especially if I worked horizontally rather than vertically.

(oh, and each person will have their own hCard - my first use of microformats :) )

ytswy

4:56 pm on Jul 10, 2006 (gmt 0)

10+ Year Member



I think nested lists are always the way to go, but then I like nested lists for some reason.

I wonder if nested definition lists might be suitable - put the main person in the first <dt>, then their spouse in a subsequent <dt>. Each child with that spouse gets a <dd> with a nested <dl> which contains their name, and their spouses and children represented in the same way. Subsequent spouses can have a <dt> after the <dd>s of the children of the previous spouse, with <dd>s following for their children.

I think that makes sense (feel free to disagree ;)), for example (added dashes for indentation):

<dl>
-<dt>Main Person</dt>
-<dt>Main person's spouse</dt>
-<dd><dl>
--<dt>1st child of main person</dt>
--<dt>Spouse, of 1st child of main person</dt>
--<dd><dl>
---<dt>1st child of 1st child of main person</dt>
---<dt>spouse of above</dt>
---<dd><dl>**1st child, spouses and descendents**</dl></dd>
--</dl></dd>
-</dl></dd>
-<dd><dl>
--<dt>2nd child of main person</dt>
--<dt>1st spouse of 2nd child of main person</dt>
--<dd><dl>**1st child with 1st spouse**</dl></dd>
--<dd><dl>**2nd child with 1st spouse**</dl></dd>
--<dt>2nd spouse of 2nd child of main person</dt>
--<dd><dl>**1st child with 2nd spouse (3rd child total)**</dl></dd>
-</dl></dd>
</dl>

Quite how you'd deal with anyone marrying a distant cousin I don't know..

birdbrain

7:07 pm on Jul 10, 2006 (gmt 0)



Hi there Robin_reala,

here is an example that may amuse you. ;)


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>family tree using 32 divs </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
h1 {
width:580px;
font-family:verdana,arial,helvetica,sans-serif;
font-size:18px;
text-align:center;
margin:40px auto;
}
#container {
width:580px;
font-family:verdana,arial,helvetica,sans-serif;
font-size:11px;
text-align:center;
margin:auto;
}
#container a {
display:block;
color:#000;
text-decoration:none;
background-color:#f6f6ff;
}
#container a:hover {
color:#900;
background-color:#f6f6ff;
}
#no1 {
width:190px;
line-height:60px;
border:1px solid #000;
margin:auto;
}
#no1 a {
height:60px;
}
#line1 {
font-size:0;
width:1px;
height:20px;
color:#fff;
background-color:#000;
margin:auto;
}
#line2 {
font-size:0;
width:424px;
height:1px;
color:#fff;
background-color:#000;
margin:auto;
}
#line3 {
font-size:0;
display:inline;
width:1px;
height:20px;
color:#fff;
background-color:#000;
margin-left:78px;
float:left;
}
#line4,#line5,#line6 {
font-size:0;
display:inline;
width:1px;
height:20px;
color:#fff;
background-color:#000;
margin-left:140px;
float:left;
}
#no2 {
display:inline;
border:1px solid #000;
clear:both;
margin-left:35px;
float:left;
}
#no2 a,#no4 a,#no8 a {
width:84px;
height:50px;
padding-top:8px;
}
#no3 {
display:inline;
border:1px solid #000;
margin-left:58px;
float:left;
}
#no3 a,#no5 a,#no6 a,#no7 a,#no9 a {
width:84px;
height:42px;
padding-top:16px;
}
#no4 {
display:inline;
border:1px solid #000;
margin-left:53px;
float:left;
}
#no5 {
display:inline;
border:1px solid #000;
margin-left:55px;
float:left;
}
#line7,#line13 {
font-size:0;
display:inline;
width:1px;
height:38px;
color:#fff;
background-color:#000;
margin-left:219px;
float:left;
}
#line8,#line14 {
font-size:0;
display:inline;
width:1px;
height:38px;
color:#fff;
background-color:#000;
margin-left:281px;
float:left;
}
#no6,#no8 {
display:inline;
border:1px solid #000;
margin-left:107px;
float:left;
}
#line9,#line11,#line15,#line17 {
font-size:0;
display:inline;
width:26px;
height:1px;
color:#fff;
background-color:#000;
margin-top:29px;
float:left;
}
#line10,#line12,#line16,#line18 {
font-size:0;
display:inline;
width:1px;
height:60px;
color:#fff;
background-color:#000;
float:left;
}
#line16,#line18 {
height:30px;
}
#no7,#no9 {
display:inline;
border:1px solid #000;
margin-left:169px;
float:left;
}
.clear {
clear:both;
}
-->
</style>

</head>
<body>

<h1>A simple family tree using 32 divs</h1>

<div id="container">

<div id="no1"><a href="">Managing Director</a></div>
<div id="line1"></div>
<div id="line2"></div>
<div id="line3"></div>
<div id="line4"></div>
<div id="line5"></div>
<div id="line6"></div>
<div id="no2"><a href="#">Sales &amp; Marketing Director</a></div>
<div id="no3"><a href="#">Production Director</a></div>
<div id="no4"><a href="#">Human Resources Director</a></div>
<div id="no5"><a href="#">Finance Director</a></div>
<div id="line7"></div>
<div id="line8"></div>
<div class="clear"></div>
<div id="no6"><a href="#">Factory Manager</a></div>
<div id="line9"></div>
<div id="line10"></div>
<div id="no7"><a href="#">Management Accountant</a></div>
<div id="line11"></div>
<div id="line12"></div>
<div class="clear"></div>
<div id="line13"></div>
<div id="line14"></div>
<div class="clear"></div>
<div id="no8"><a href="#">Quality Control Manager</a></div>
<div id="line15"></div>
<div id="line16"></div>
<div id="no9"><a href="#">Financial Accountant</a></div>
<div id="line17"></div>
<div id="line18"></div>
<div class="clear"></div>

</div>

</body>
</html>

birdbrain

Robin_reala

9:01 pm on Jul 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ytswy: so the definition of parents is their children? Deep! :) I see where you're coming from though, it's not an angle I'd considered. To solve the spouse solution I was planning on classing up the spouse's entry differently and adding it to the same <li> as the blood relative, but your idea bears thought.

birdbrain: Ingenious :) Still, ideally I'd be capturing the heirachy in the HTML, not just in the display layer. Looks cool though.

leadegroot

11:52 pm on Jul 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have this weird idea that the spouses (spice? ;)) doesn't matter, its the bloodlines (*cough*) that matter, so spouses shouldn't appear in descendant trees, only in a detail page for the person, and in ancestor trees (both different kettles of fish)
Basic reasoning is that multiple spouses with children make the semantics difficult.

ytswy

12:18 pm on Jul 11, 2006 (gmt 0)

10+ Year Member



I'm afraid my total lack of knowledge about genealogy is showing.. I just saw a chance to proletyse the definition list, which I can never resist.