Page 1 of 1

if < than 40 then change color

Posted: Mon Mar 10, 2014 5:46 pm
by leverkusen
hey i have this
echo '<td align="center"><font style=color:lightblue size="2"><b>'.intval(100*$row['win']/$row['played']).'%</b></font></td>';
this calculates % of won games
i want to make a color to red when % is lower than 40%, yellow when is 40-60% and green when is more than 60%
how can i do that? if result <40 then show this row in red color

Re: if < than 40 then change color

Posted: Tue Mar 18, 2014 10:20 pm
by Temor
Have you tried yourself? This really is the easiest thing one can do in programming. It's just simple IF statements.

IF <= 40 $color = red
IF > 40 && < 60 $color = yellow
IF > 60 $color = green

Re: if < than 40 then change color

Posted: Thu Feb 12, 2015 9:36 pm
by leverkusen
Thanks, this worked, its solved! :D