struts多列列表显示

结合struts的iterate tag+JSTL1.1实现多列列表的显示。下面一段示例代码中显示的是2列,如果想显示多列,则直接把2改成自己想显示的列数即可。
<nested:iterate property="items" indexId="index">
                                                  
<c:if test="${index%2==0}">
                                                  
<tr>
                                                  
</c:if>   
                                                     
<td>
                                                        $
{index}
                                                     
</td> 
                                                  
<c:if test="${(index+1)%2==0}">
                                                     
</tr>
                                                
</c:if>
11                                            
12                                         </nested:iterate>
posted @ 2007-10-16 17:29    阅读(586)  评论(1编辑  收藏  举报