首页 > 代码库 > jsp 页面实现增减行

jsp 页面实现增减行

1、页面加入

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

2、增减行页面代码

  <c:forEach items="${datalist}" var="datalistcpy1" varStatus="status">
    <c:if test="${status.index < fn:length(datalist)-1 }">
     <tr>
       <td align="center">${status.index+1}</td>
       <td align="center">${datalistcpy1.szdwmc}</td>
       <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(datalistcpy1.gyxjzzzje)}" pattern="0.00"/></td>
       <td align="center">*</td>
       <td align="center">*</td>
       <td align="center">*</td>
       <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(datalistcpy1.fgyxjzzzje)}" pattern="0.00"/></td>
       <td align="center">*</td>
     </tr>
    </c:if>
    <c:if test="${status.index eq fn:length(datalist)-1 }">
     <tr>
    <td align="center">合计</td>
    <td align="center">— —</td>
    <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(dataListdcdsdj.hjzzje)}" pattern="0.00"/></td>
    <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(dataListdcdsdj.hjasskdjsdkcxe)}" pattern="0.00"/></td>
    <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(dataListdcdsdj.hjssje)}" pattern="0.00"/></td>
    <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(dataListdcdsdj.hjnstzje)}" pattern="0.00"/></td>
    <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(dataListdcdsdj.zzje)}" pattern="0.00"/></td>
    <td align="center"><fmt:formatNumber value="${hlbm:getValueByNull(dataListdcdsdj.hjnstzje)}" pattern="0.00"/></td>
   </tr>
   </c:if>
 </c:forEach>

 

jsp 页面实现增减行