Set the color property of text for the given td based on the value fetched from the tabe.
if value is 'late'
<td style="color: red;">late</td>
else
<td style="color: green;">on time<td>
You can use normal conditional statements to do this work though it would be better if you use JSTL tags to do conditional branching.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
I can churn out alternatives only if you provide me with the code you have so far. What I presented in my previous post was a fairly easy thing to have done. If you are not able to achieve it, post the most recent code.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
<%
String pGoal = rs.getString("pGoal");
if(pGoal.equals("met"))
out.println("<td style='background-color: green;'>" + pGoal + "</td>")
else
out.println("<td style='background-color: red;'>" + pGoal + "</td>")
%>
I would not recommend scriptlets but I don't think you care about it though...
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
Why not create a stylesheet class for each color?
.
.bred {background-color: red;}
.bgrn {background-color: green;}
Then just insert the correct classes when you put the values in the tables, either directly or through a script:
<td class="bgrn">met</td>
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
I have already answered your question in post #6. If you still can't figure that out, try reading some good JSP and Servlet tutorials till you have a good grasp of the subject matter.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734