The sample code for dynamically merging cells in JSP. Does jsp dynamically merge cells?
The Code is as follows:
<Span style = "font-size: 14px;"> <% @ taglib prefix = "c" uri =" http://java.sun.com/jsp/jstl/core "%> <Table width =" 100% "border =" 0 "cellspacing =" 0 "cellpadding =" 0 "> <tr> <th> report name </th> </ tr> <c: set var = "tempCount" value = "0"> </c: set> <% -- temporary variable -- %> <c: set var = "rowspanCount" value = "0"> </c: set> <% -- Record merged columns -- %> <c: set var = "tempFrist" value = "0"> </c: set> <% -- start position of record merging -- %> <c: set var = "tempEnd" value = "-1"> </c: set> <% -- end position of record merging -- %> <c: forEach items = "$ {list}" var = "accountConfig" varStatus = "status"> <tr> <% -- generate a result set List <Bean>, too much data will increase the customer's interruption burden -- %> <c: if test = "$ {status. index> = tempEnd} "> <c: set var =" rowspanCount "value =" 0 "> </c: set> <% -- clear historical data -- %> <c: forEach var = "item2" items = "$ {list}" varStatus = "status2"> <% -- tablename indicates the attribute to be merged -- %> <c: if test = "$ {accountConfig. tablename = item2.tablename} "> <c: set var =" tempFrist "value =" $ {status. index} "> </c: set> <c: set var =" rowspanCount "value =" $ {rowspanCount + 1} "> </c: set> <c: set var = "tempEnd" value = "$ {tempFrist + rowspanCount}"> </c: set> </c: if> </c: forEach> </c: if> <c: if test = "$ {status. index = tempFrist} "> <td rowspan =" $ {rowspanCount} "> <% -- tablename indicates the attribute to be merged -- % >$ {accountConfig. tablename} </td> </c: if> </tr> </c: forEach> </table> </span>
The above is the sample code for dynamically merging cells in JSP introduced by xiaobian. I hope it will be helpful to you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!