With help from ahundiak on the php forum I now have an array of relatives which I want to display like this:
More by luck than anything else I currently have:
To do this I have created a div for each image in the php loop that displays the data. Each generation has a number and to get the horizontal spacing I have multiplied the generation number by 265. This is the code for the div:
As you can see I need to sort the vertical spacing and before I tried to do it with the method I currently have I wondered if I am barking up the wrong tree.
Has anyone any comments or alternative methods that would be better / easier to implement ?
Nearly forgot - this is the data I am working with and the first number is the generation which I can use in any if statements or calculations.
I was wondering about using columns; if you have any ideas I can implement them as so far I am ony trying out different ideas.
The problem I am having currently is when I am changing top margins and the top relative spacing on one div it is messing up another. My latest div as an example from the html is:
<body>
<div id="maincontainer">
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 600;
left: 0;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 0<br>
ID number = 1<br>
Kenel club name = Willow as in tree </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 200;
left: 265;
margin-top: 250;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 1<br>
ID number = 2<br>
Kenel club name = Puppies father </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 200;
left: 265;
margin-top: 250;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 1<br>
ID number = 3<br>
Kenel club name = Puppies mother </div><br>
Well your best best would be to have columns of the data and place each level accordingly. Right now it looks like relative positioning (or margins) would achieve the effect you want.
Your current HTML/CSS would be needed if you want exact code :).
As I say I am creating the css dynamicaly from within the php code but if you can sort out the layout etc. I should be able to write that into my code.
The layout is a bit different to the photo now as I have been messing with the top margin etc. a bit on the first 3 boxes from the left.
<html>
<head>
<style>
body {
margin:0;
padding:0;
line-height: 1.5em;
}
#maincontainer {
width: 960px;
margin: 0 auto;
}
</style>
<body>
<div id="maincontainer">
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 600;
left: 0;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 0<br>
ID number = 1<br>
Kenel club name = Willow as in tree </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 200;
left: 265;
margin-top: 250;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 1<br>
ID number = 2<br>
Kenel club name = Puppies father </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 200;
left: 265;
margin-top: 250;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 1<br>
ID number = 3<br>
Kenel club name = Puppies mother </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 530;
margin-top: 20;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 2<br>
ID number = 4<br>
Kenel club name = Grandparent 21 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 530;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 2<br>
ID number = 5<br>
Kenel club name = Grandparent 22 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 530;
margin-top: 20;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 2<br>
ID number = 6<br>
Kenel club name = Grandparent 23 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 530;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 2<br>
ID number = 7<br>
Kenel club name = Grandparent 24 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 8<br>
Kenel club name = GT Grandparent 31 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 9<br>
Kenel club name = GT Grandparent 32 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 10<br>
Kenel club name = GT Grandparent 33 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 11<br>
Kenel club name = GT Grandparent 34 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 12<br>
Kenel club name = GT Grandparent 35 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 13<br>
Kenel club name = GT Grandparent 36 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: lightblue;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 14<br>
Kenel club name = GT Grandparent 37 </div><br>
<div style="
position: relative;
padding: 0px 5px 1px 5px;
top: 20;
left: 795;
margin-top: 20;
background-color: pink;
border: 1px black solid;
width:250px;">Generation = 3<br>
ID number = 15<br>
Kenel club name = GT Grandparent 38 </div><br>
</div>
</body>
</html>
The first photo was created with css BUT I had a div for every position. I could do it again this way but would need nearly 40 different divs.