hey i have this [syntax=php]
echo '<td align="center"><font style=color:lightblue size="2"><b>'.intval(100*$row['win']/$row['played']).'%</b></font></td>';[/syntax]
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
if < than 40 then change color
- leverkusen
- Posts: 69
- Joined: Sun Nov 18, 2012 10:09 pm
- Location: Belgrade
- Contact:
Re: if < than 40 then change color
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
IF <= 40 $color = red
IF > 40 && < 60 $color = yellow
IF > 60 $color = green
- leverkusen
- Posts: 69
- Joined: Sun Nov 18, 2012 10:09 pm
- Location: Belgrade
- Contact:
Re: if < than 40 then change color
Thanks, this worked, its solved!