This topic is locked

conditional formatting - font color

12/4/2007 9:30:43 AM
PHPRunner General questions
J
jskewes author

Hello,

Can anyone suggest how to make this condition apply to FONT COLOR?

This code works for bgcolor but changing font color might make a nicer display.

Thanks in advance.

/john
$str = "<table width=100% bgcolor=";

if ($value="DONE")

$str.="green";

if ($value="NOT STARTED")

$str.="red";

str.="><tr><td>".$value."</td></tr></table>";

$value=$str;

J
jskewes author 12/4/2007

Hi - I got this to work using this piece of code (where CPO is the field name).

Thank you.

/john
global $data;

$str = "<font color=";

if ($data["CPO"]=="CPO")

$str.="green";

if ($data["CPO"]=="NON")

$str.="red";

$str.=">".$value."</font>";

$value=$str;

Hello,

Can anyone suggest how to make this condition apply to FONT COLOR?

This code works for bgcolor but changing font color might make a nicer display.

Thanks in advance.

/john
$str = "<table width=100% bgcolor=";

if ($value="DONE")

$str.="green";

if ($value="NOT STARTED")

$str.="red";

str.="><tr><td>".$value."</td></tr></table>";

$value=$str;