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>