【发布时间】:2019-11-10 16:01:26
【问题描述】:
我尝试在单个单元格中显示一个集合,但它为每个元素创建一个列。
我尝试了许多将 HTML 与 Thymeleaf 属性相结合的变体,但我不知道如何为 th:each 循环显示带有文本的单个单元格
<tr th:each="employee : ${allEmployees}">
<td th:text="${employee.id}"></td>
<td th:text="${employee.firstName}"></td>
<td th:text="${employee.lastName}"></td>
<td th:text="${employee.position}"></td>
<td th:text="${employee.salary}"></td>
<td th:text="${employee.supervisorId}"></td>
<!--Here-->
<td th:each="team : ${employee.teams}" th:text="${team.name}"></td>
</tr>
我期待像 || 这样的东西技术架构,移动 || 但我不断得到 ||技术架构 ||移动 || 等(不介意昏迷和空格)
【问题讨论】: