想在页面上的一个table 三列多行中输出,list的每个元素为一格,不是一行
效果如下:
<tr>
<td>name1</td>
<td>name2</td>
<td>name3</td>
</tr>
<tr>
<td>name4</td>
<td>name5</td>
<td>name6</td>
</tr>
可以这么实现:
<table>
<th>
<td>name</td>
<td>age</td>
</th>
<#list userList as user>
<#if user_index%3 e 0>
<tr>
</#if>
<td>${user.name}</td>
<#if user_index%3 e 2>
</tr>
</#if>
</#list>