<td nowrap class="tdjj" align="center">
<c:if test="${list.profitmoney < '0'}">
<font color="red">${list.profitmoney}</font>
</c:if>
<c:if test="${list.profitmoney >= '0'}">
<font color="black">${list.profitmoney}</font>
</c:if>
<c:if test="${list.profitmoney < '0'}">
<font color="red">${list.profitmoney}</font>
</c:if>
<c:if test="${list.profitmoney >= '0'}">
<font color="black">${list.profitmoney}</font>
</c:if>
</td>
${list.profitmoney}是jsp页面查询出来的某个变量的值。
上面代码是为了实现如果为负值,字体颜色标红。如果为正值或者0,则字体颜色为黑。