在这种特定情况下,您可以将
th:each
分别移动到 table
和 tr
元素上:
<table th:each="claim:${claimEditor}">
<tr>
<td>Number of claim : </td>
<td th:text="${claim.numberOfClaim}"></td>
</tr>
<th:block th:unless="${#lists.isEmpty(claim.record)}">
<tr th:each="record, iterStat:${claim.record}">
<td th:rowspan="${record.size()} th:if="${iterStat.first}">Attribute : </td>
<td th:text="${record}"></td>
</tr>
</th:block>
</table>