4
は、私は、リスト内のリストを持っていると同じように見えます:私はモデルにそれを与えている私のコントローラで反復
List<List<Integer>> coverage
。 私のテンプレートでは、リスト内の整数のリストを繰り返し、1つのテーブルにこれを表示します。
<table class="table table-hover table-bordered">
<tr>
<td class="table-colspan" colspan="1" >1</td>
<td class="table-colspan" colspan="1" >2</td>
<td class="table-colspan" colspan="1" >3</td>
<td class="table-colspan" colspan="1" >4</td>
<td class="table-colspan" colspan="1" >Total</td>
<td class="table-colspan" colspan="1" >6</td>
</tr>
<tr class="title-tr" th:each="list : ${coverage}">
<tr class="title-tr" th:each="r, iterationStatus : ${list}">
<tr th:text="${r}"></tr>
<td th:text="${r}" ></td>
<td th:text="${r}"></td>
<td th:text="${r}"></td>
<td th:text="${r}"></td>
<td th:text="${r}"></td>
</tr>
</tr>
</table>
私は最初、私は整数を表示するList<Integer>
自体を反復処理し、この後、各List<Integer>
を取得するために、リストを反復。 しかし、List<Integer>
の各整数は、独自の行を取得します。したがって、List<Integer>
の最初の整数は6回表示されます。
どうすればこの問題を解決できますか?
私は自分の状況が十分に晴れていないことを願っています。そうでなければ、私は追加情報を提供します。前もって感謝します。
はthymeleafを@Dragonthoughtsコードは私の質問です。 – Urban