CSS refuses to obey my wishes
i want to have the data in a centered box, but i print it, with all the cells set to absolute positioning with position determined by php, and they dont go in the box, and the box goes to its minimum size. its really annoying
this is my code
you can see the page at alex.jowigo.com/schedule.php
<html>
<head>
<title> Uxbridge Library Schedule </title>
</head>
<style type="text/css">
#main {
width:1004px;
margin-right:auto;
margin-left:auto;
margin-top:10px;
padding:0px;
text-align:left;
border:1px solid #000;
}
#head
{
border-width:thin;
width:100px;
border-style:solid;
border-top-width:0px;
position:absolute;
text-align:center;
}
#datum
{
border-width:thin;
width:100px;
border-style:solid;
border-top-width:0px;
border-bottom-width:0px;
position:absolute;
text-align:center;
}
</style>
<body>
<?php
$filepath = "hours.csv";
$f = fopen($filepath,"r");
for($i=1 ; $i <= 54 ; $i++)
{
$inp=fgets($f);
for($x=1;$x<=7;$x++)
{
$tmp = stristr($inp,",");
$res[$i][$x] = substr($inp,0,strlen($inp)-strlen($tmp));
$inp=substr($tmp,1,strlen($tmp));
}
}
for($x=1;$x<8;$x++)
{
for($i=1;$i<3;$i++)
{
$bordertype[$i][$x]="head";
}
for($i=3;$i<27;$i++)
{
$bordertype[$i][$x]="datum";
}
for($i=27;$i<30;$i++)
{
$bordertype[$i][$x] ="head";
}
for($i=30;$i<55;$i++)
{
$bordertype[$i][$x]="datum";
}
}
$rowheight = 20;
<div id='main'>
for($i=1;$i<55;$i++)
{
for($x=1;$x<8;$x++)
{
$result = $result . "<div id='" . $bordertype[$i][$x] . "' style='left: " . 100 * ($x - 1) . "px; top: " . $i * $rowheight . "px ' > " . $res[$i][$x] . "</div>";
}
</div>
}
echo $result;
?>
</body>
</html>

