如果是服务器端的数据直接判断颜色。
就在不同的c:if里写不同颜色的 tr 就好了。
<c:if test="....">
<tr bgcolor=“RED">
</c:if>
<c:if test="....">
<tr bgcolor=“GREEN">
</c:if>
<td>...</td>
</tr>
呵呵,既然你要判断它的值,为什么不把它组成嵌套标签。<c:forEach var="pur" items="${rolepur.purs}">
<c:if test="${pur.purId==1 }">
//这里是要执行的内容
</c:if>
</c:forEach>