thymeleaf 循环ListListOrdCart
在Thymeleaf中,可以使用th:each指令来循环遍历List<List
<table>
<tr th:each="cartList : ${cartLists}">
<td>
<table>
<tr th:each="cart : ${cartList}">
<td th:text="${cart.id}"></td>
<td th:text="${cart.name}"></td>
<td th:text="${cart.price}"></td>
</tr>
</table>
</td>
</tr>
</table>
在上面的示例中,cartLists是一个List<List${cart.id}、${cart.name}和${cart.price}可以访问内部List中的属性。
注意:在使用Thymeleaf循环遍历List<List
原文地址: https://www.cveoy.top/t/topic/hNdN 著作权归作者所有。请勿转载和采集!