页面显示三纵三横

来源:互联网 发布:js与jsp数据交互 编辑:程序博客网 时间:2024/06/06 18:06

 <table width="100%" border="0" cellspacing="0" cellpadding="0">
     <% List<Groups> lists = (List)request.getAttribute("fcgroup");
                    if (lists !=null && !lists.isEmpty()){ 
                     for (Groups g:lists){  
                     if(lists.indexOf(g)%3==0){ %>
                     <tr>
                     <%} %>
                   <td align="center" valign="top" height="48" width="60" ><a href="<%=request.getContextPath()%>/groupShowAction.do?action=show&id=<%=g.getId()%>">  <img src="<%=request.getContextPath()%>/groupImages/<%=g.getGroupLogo()%>" width="48" height="48" /> </a>
     <br/>
     <a href="<%=request.getContextPath()%>/groupShowAction.do?action=show&id=<%=g.getId()%>""><%=g.getTitleShow()%> </a>
    </td>
     <%} }else{%>
       <tr>
      <td align="center" valign="top"><img src="<%=request.getContextPath()%>/groupImages/defaultgroup.jpg" width="48" height="48" />
       <br />
       暂无新圈子建立</td>
      </tr>
     <%} %>
                    </table>

原创粉丝点击