Click to See Complete Forum and Search --> : [RESOLVED] Works in IE but not Firefox


billiondevil
06-25-2009, 08:43 AM
ok i am working on a new rpg styled game in php and i have hit a problem, i am trying to make a hp bar and a brave bar that go up and down. it works like a dream in IE but when i tryed it in firefox none of the bars turn up. here is the web address, I know this isnt a php strictly based problem but does anyone know how i can fix this?
mcilveen.100webspace.net (http://mcilveen.100webspace.net/) and here is my code $hpwidth=$userstats['hp']/$userstats['maxhp']*100;
if($hpwidth<"33"){$color="bars_red.gif";}
elseif($hpwidth<"66"){$color="bars_yellow.gif";}
else{$color="bars_green.gif";}

echo "HP: ".$userstats['hp']."/".$userstats['maxhp']."<br />";
echo "<table cellspacing='0' cellpadding='0'><tr><td style='padding:0px; width:100px; height:12px; border:solid 1px black; vertical-align:bottom;'>\n";
echo "<div style='padding:0px; width:".$hpwidth."px; border-top:solid 0px black; background-image:url(images/".$color.");'></div>";
echo "</td></tr></table>";

$bravewidth=$userstats['brave']/$userstats['maxbrave']*100;
if($bravewidth<"33"){$color="bars_red.gif";}
elseif($bravewidth<"66"){$color="bars_yellow.gif";}
else{$color="bars_green.gif";}

echo "Brave: ".$userstats['brave']."/".$userstats['maxbrave']."<br />";
echo "<table cellspacing='0' cellpadding='0'><tr><td style='padding:0px; width:100px; height:12px; border:solid 1px black; vertical-align:bottom;'>\n";
echo "<div style='padding:0px; width:".$bravewidth."px; border-top:solid 0px black; background-image:url(images/".$color.");'></div>";
echo "</td></tr></table>";

thanks in advance

scrupul0us
06-25-2009, 08:44 AM
do we have to login to see the results of your code?

billiondevil
06-25-2009, 09:11 AM
unfortunatly u will cos i have already done the coding for it

scrupul0us
06-25-2009, 09:45 AM
can you post a temp l/p for us to use?

billiondevil
06-25-2009, 10:12 AM
kk its here
mcilveen.100webspace.net/test.php (http://mcilveen.100webspace.net/test.php)

scrupul0us
06-25-2009, 10:42 AM
try putting an &nbsp; in the div or td that displays the bars

i know firefox wont render a completely empty cell as IE will

billiondevil
06-25-2009, 02:23 PM
thx alot it wroked fine after that

scrupul0us
06-25-2009, 02:55 PM
no prob :)