我是 jsp 和 spring 的新手,从控制器,我将一个(启用)布尔值传递给 jsp 页面,并在迭代时为每个页面组件分配值,如果启用为 false,我想更改行颜色。
你能告诉我什么是最好的方法吗
<table id="DetailTable" class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th>S/no</th>
<th>Serial No</th>
<th>enabled</th>
<th>File Name</th>
</tr>
</thead>
<tbody>
<c:forEach items="${PropertiesLst}" var="Properties" varStatus="cnt">
<c:if test="${not empty Properties.serialNum }">
<tr <c:if test="${!Properties.enable}"> class="red"</c:if>>
<td>${cnt.index+1}</td>
<td>${Properties.enabled}</td
<td>${Properties.filename}</td
</tr>
</c:if>
</c:forEach>
</tbody>
</table>
如果布尔值为假,表格内的行应该是红色的。否则应该 bld