1、freemaker循环输出list数据的格式我们都知道是
<#list user as userList>
${user.username}
</#list>
2、但是如果list里面还有list对象,需要循环嵌套输出数据呢?
也很简单,就是按照格式多写一个循环。
<#list userDetails as userInfo>
${userInfo.regulation}
<table class="table">
<tbody>
<thead>
<tr>
<td>客户姓名</td>
<td>证件号码</td>
</tr>
</thead>
<#list userInfo.userList as user>
<tr>
<td>${user.idName}</td>
<td>${user.idNumber}</td>
</tr>
</#list>
</tbody>
</table>
<br>
</#list>