日期:2014-05-17 浏览次数:20605 次
<tr> <td height="62" background="images/office_r9_c7.jpg" width="871"> <a href="of_detail.jsp?id=<%=news.getID() %>"class="pt1"> <div align="center" class="bluept"><%=news.getTITLE() %></div></a> </td> <td height="62" background="images/office_r9_c7.jpg" width="871"> <a href="of_detail.jsp?id=<%=news.getID() %>"class="pt1"> <div align="center" class="bluept"><%=news.getTITLE() %></div></a> </td> </tr>
------解决方案--------------------
每两个换行吗?
<% for(int i =0;i<list.size();i++){ News news = (News)list.get(i); if(i%2==0) { %> <tr> <%}%> <td height="62" background="images/office_r9_c7.jpg" width="871"> <a href="of_detail.jsp?id=<%=news.getID() %>"class="pt1"> <div align="center" class="bluept"><%=news.getTITLE() %></div></a> </td> <% if((i+1)%2==0) { </tr> <%}%> <%} %>
------解决方案--------------------
楼主怎么又发一次?
<% boolean flag = true; for(int i =0;i<list.size();i++){ ea =(Expert_team)list.get(i); if(flag){ %> <tr> <td><%=ea.getNAME()%><%flag=false;%></td> <%}else{%> <td><%=ea.getNAME()%><%flag=true;%></td></tr> <% } } %>
------解决方案--------------------
<%
for(int i =0;i<list.size();i+=2){
// 第一列
News news = (News)list.get(i);
//第二列
if(i+1<list.size()) {
news = (News)list.get(i+1);
}else {
//<td> </td>
}
%>
------解决方案--------------------