jstl标签的使用 控制table中行列的显示

来源:互联网 发布:mac怎么取消客人用户 编辑:程序博客网 时间:2024/04/28 02:20
 

<table align="left"  width="50%" border="0" bgcolor="#FFFFFF" height=100%>

                                <c:forEach items="${synUserInfo.msisdnList}" var="a" varStatus="b">
                                   
                                 <c:if test="${b.index%4==0}">
                                   <tr>
                                      <td style="padding:5px 5px 5px 5px;"><c:out value="${a}"/></td>
                                   </c:if>
                                   <c:if test="${b.index%4==1||b.index%4==2}">
                                      <td style="padding:5px 5px 5px 5px;"><c:out value="${a}"/></td>
                                    </c:if>
                                   <c:if test="${b.index%4==3}">
                                      <td style="padding:5px 5px 5px 5px;"><c:out value="${a}"/></td>
                                   </tr>
                                   </c:if>
                                </c:forEach>

      </table>

 

以上代码实现table中每行显示4列   4列就换行

原创粉丝点击