I have an array that i populate a genealogy table with. It is in order like this:
---------3
----1
--------4
0
--------5
----2
--------6
and so on... an example is http://bullybloodlines.net/dogdetails.php?name=muscletone%27s+lucky+bam+bam+of+power+line+bullys
my code for this is:
<?php
$generations = 4;
$genTableArray = array();
for($genCol = 0; $genCol <= $generations; $genCol++)
{
$genRowCount = pow(2, $genCol);
$rowspan = pow(2, $generations) / $genRowCount;
for($familyGenCount=0; $familyGenCount<$genRowCount; $familyGenCount++)
{
$personIndex = pow(2, $genCol) + $familyGenCount - 1;
$rowIndex = $rowspan * $familyGenCount;
$encodedog = urlencode($dogarr[$personIndex]);
$genTableArray[$rowIndex][] = "<td rowspan='{$rowspan}'><a href='http://bullybloodlines.net/dogdetails.php?name={$encodedog}'><img src='images/dogpics/{$dogpic[$personIndex]}' width=100/><br><br>{$dogarr[$personIndex]}</a></td>\n";
}
}
ksort($genTableArray);
$familyTreeHTML = '';
foreach($genTableArray as $rowData)
{
$familyTreeHTML .= "<tr>\n" . implode("\n", $rowData) . "</tr>\n";
}
?>
<table border='1' align='center' cellpadding='4' style='border-collapse:collapse;'>
<?php echo $familyTreeHTML; ?>
</table>
This works fine. However, my goal is to change the layout and use CSS to create something like, http://thecodeplayer.com/walkthrough/css3-family-tree but horizontal like my table is.
Ive tried adding this to the css to rotate it:
.tree{
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* IE6, IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)" /* IE8 */
-ms-transform: rotate(-90deg);
}
It does rotate but text is displayed sideways as well. That is my first issue. I am also having trouble using my array to populate this with the way it is arranged. The "css3-family" tree uses nested lists. Any help would be greatly appreciated. Thank you.