For each operator in Thymeleaf

前端 未结 2 1401
-上瘾入骨i
-上瘾入骨i 2020-12-17 07:34

I can not find syntax for building simple for-each-loop in Thymeleaf template. I\'m not satisfied with just th:each=\"\" attribute, because it copi

2条回答
  •  余生分开走
    2020-12-17 08:13

    The th:block solution is definitely the best one, but alternatively you can also try using th:remove="tag" in order to remove the containing tag:

    ... ...
    ...

    The benefit of this approach is that you can also pass a Thymeleaf expression to th:remove in order to only remove the tag conditionally, e.g. if you want only some users to be included in a , besides having other interesting uses.

    Here is the documentation for th:remove.

提交回复
热议问题