Link to home
Start Free TrialLog in
Avatar of j8547
j8547

asked on

change display color in table if criteria is true

I have information pulling from the database. I have a Select statement where is dates are in certain ranges the job has a certain status. I have colored the columns in the table but instead of this I would like to color the cell depending on the status. So if it is in 'Production' it would be red. 'Shipped' then blue and so on....Not sure if I can add it to my Select where is prints to the table when case is true or if I need an IF statement. Any help appreciated. Code and screenshot attached.
index.php
print-screen.jpg
Avatar of Jan Louwerens
Jan Louwerens
Flag of United States of America image

Instead of hard-coding the colors in the html, you should just give each table cell a class (which would be determined rhe same way as the table cell contents), then use css to define the color of the table cell.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial