Skip to content

Commit

Permalink
[BAEL-1671] Iteration in Thymeleaf (eugenp#3987)
Browse files Browse the repository at this point in the history
* [BAEL-1671] Iteration in Thymeleaf

* [BAEL-1671] Iteration in Thymeleaf

* [BAEL-1671] Iteration in Thymeleaf
  • Loading branch information
felipeazv authored and pivovarit committed Apr 26, 2018
1 parent ba1ba84 commit 3998fff
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spring-thymeleaf/src/main/webapp/WEB-INF/views/listStudents.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,23 @@ <h1>Student List</h1>
<th th:text="#{msg.name}" />
<th th:text="#{msg.gender}" />
<th th:text="#{msg.percent}" />
<th th:text="index" />
<th th:text="count" />
<th th:text="first" />
<th th:text="last" />
</tr>
</thead>
<tbody>
<tr th:each="student: ${students}">
<tr th:each="student, iStat : ${students}" th:style="${iStat.odd}? 'font-weight: bold;'" th:alt-title="${iStat.even}? 'even' : 'odd'">
<td th:text="${student.id}" />
<td th:text="${{student.name}}" />
<td th:text="${student.name}" />
<td th:switch="${student.gender}"><span th:case="'M'"
th:text="Male" /> <span th:case="'F'" th:text="Female" /></td>
<td th:text="${#conversions.convert(student.percentage, 'Integer')}" />
<td th:text="${iStat.index}" />
<td th:text="${iStat.count}" />
<td th:text="${iStat.first}" />
<td th:text="${iStat.last}" />
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 3998fff

Please sign in to comment.