Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change background color of a row

Status
Not open for further replies.

james0816

Programmer
Jan 9, 2003
295
US
Is it possible to change the background color of a row if a variable is set to a certain value?

I am currently displaying my records and looking good. now..when my variable gets set to "1", I would like to change the background color of that row only.

not sure how to go about this using php.

thx
 
Code:
if ($value==1)
{
    echo"<tr bgcolor=colorA>";
}
else
{
    echo"<tr bgcolor=colorB>";
}

Is this what you need?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top