【发布时间】:2021-12-29 03:40:36
【问题描述】:
我正在尝试 th:text 在我的 div 中,但它似乎不起作用
我尝试用一个表来做,我得到了我需要的数据,但是当我把它放在一个 div 中时它不起作用
<div class="info" data-th-each="shoes: ${shoesList}">
<p th:text="$(shoes.name)"></p>
<p th:text="$(shoes.description)"></p>
<p th:text="$(shoes.price)"></p>
</div>
这很有效
<table>
<tr data-th-each="shoes : ${shoesList}">
<td th:text="${shoes.name}"></td>
<td th:text="${shoes.description}"></td>
<td th:text="${shoes.price}"></td>
</tr>
</table>
【问题讨论】:
标签: java spring-boot thymeleaf backend