List ThymileAF,具有区域列表值的地图对象。?
假设我们有一个地图对象,它的键是State,值是State中的区域列表。这就是我在这种地图对象上迭代的方式。但是每个地区并没有打印在新的一行上。有人能帮忙吗List ThymileAF,具有区域列表值的地图对象。?,list,spring-boot,dictionary,thymeleaf,List,Spring Boot,Dictionary,Thymeleaf,假设我们有一个地图对象,它的键是State,值是State中的区域列表。这就是我在这种地图对象上迭代的方式。但是每个地区并没有打印在新的一行上。有人能帮忙吗 <div th:if="${not #lists.isEmpty(stateToDistrictMap)}"> <table> <tr><td>State</td><td>Districts</td></tr> <th:b
<div th:if="${not #lists.isEmpty(stateToDistrictMap)}">
<table>
<tr><td>State</td><td>Districts</td></tr>
<th:block th:each="state : ${stateToDistrictMap}">
<tr>
<td th:text="${state.key}">State</td>
<th:block th:each="district : ${state.value}">
<td th:text="${district.name}">District</td>
<td th:text="${district.code}">District</td>
<td th:text="${district.erstyear}">District</td>
<td th:text="${district.info}">District</td>
</th:block>
</tr>
</th:block>
</table>
</div>
州行政区
陈述
地区
地区
地区
地区
有人能帮忙吗 您可能需要以下内容:
<div th:if="${not #lists.isEmpty(stateToDistrictMap)}">
<table>
<tr><td>State</td><td>Districts</td></tr>
<th:block th:each="state : ${stateToDistrictMap}">
<tr>
<td th:text="${state.key}">State</td>
<th:block th:each="district : ${state.value}">
<td th:text="${district.name}">District</td>
<td th:text="${district.code}">District</td>
<td th:text="${district.erstyear}">District</td>
<td th:text="${district.info}">District</td>
</th:block>
</tr>
</th:block>
</table>
</div>
<div th:if="${not #lists.isEmpty(stateToDistrictMap)}">
<table>
<tr>
<td>State</td>
<td>Districts</td>
</tr>
<th:block th:each="state: ${stateToDistrictMap}">
<tr th:each="district, i: ${state.value}">
<td th:text="${i.first ? state.key : ' '}" />
<td th:text="${district.name}" />
<td th:text="${district.code}" />
<td th:text="${district.erstyear}" />
<td th:text="${district.info}" />
</tr>
</th:block>
</table>
</div>
陈述
地区
District对象具有诸如District name、District code等字段,我们如何显示这些字段,请告诉我!!!我已经更新了所需的场景。请帮忙,姓名代码Est Year#Metroids你能帮忙吗?我编辑了我的答案,我猜这对你有用(因为你接受了它)?您还需要什么吗?ThanQ,它起作用了,现在正在为上面的模板计算CSS。