springboot thymeleaf常用标签

xmlns:th="http://www.w3.org/1999/xhtml"

<tr th:each="user,i : ${list}" th:class="${i.odd}?'odd'">
<td th:text="${user.username}"></td>
<td th:if="${user.sex}==1">男</td>
<td th:if="${user.sex}==0">女</td>
<td th:text="${user.phone}"></td>
<td th:text="${#dates.format(user.borthday, 'yyyy-MM-dd')}"></td>
<td>
<input type="button" value="删除" th:onclick="'getName(\''+${user.id}+'\')'">
</td>
</tr>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<!--数字循环-->
<!-- <tr class="pagination" th:each="i : ${#numbers.sequence(1, rows)}">
<td>[[${i}]]</td>
</tr>-->
<!--嵌套循环-->
<tr class="pagination" th:each="i : ${#numbers.sequence(1, rows)}">
<td th:each="deptDict,userStat : ${deptDicts}"
th:if="${userStat.index lt i*4 and userStat.index ge (i-1)*4}">
<input type="checkbox" th:value="${deptDict.deptCode}" name="deptCode">
<span th:text="${deptDict.deptName}"></span>
</td>
</tr>

posted on 2021-12-24 10:41  java-go  阅读(50)  评论(0)    收藏  举报

导航