lqxue

常用链接

统计

book

tools

最新评论

多列列表显示

                                   
结合struts的iterate tag+JSTL1.1实现多列列表的显示。下面一段示例代码中显示的是2列,如果想显示多列,则直接把2改成自己想显示的列数即可。
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

 1                                         <nested:iterate property="items" indexId="index">
 2                                                 <c:if test="${index%2==0}">
 3                                                 <tr>
 4                                                 </c:if>   
 5                                                     <td>
 6                                                         ${index}
 7                                                     </td> 
 8                                                 <c:if test="${(index+1)%2==0}">
 9                                                     </tr>
10                                                 </c:if>
11                                            
12                                         </nested:iterate>

posted on 2007-05-21 11:31 lqx 阅读(291) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: