For Loop in Thyme-leaf with Maps MVC

Viewed 23

I found how to do for loop from 1 to 5, and also how to print a map, but couldn't find both together.

I have the following:

<tr th:each="mapEntry : ${users}">
  <td><a target="_blank" th:href="@{'https://github.com/' + ${mapEntry.key}}"><span th:text="${mapEntry.key}"></span></a></td>
  <td th:each="item : ${mapEntry.value}" th:text="${item}"></td>
</tr>

I am trying to print only first 10 values. How could I do it? Thanks!

0 Answers
Related