thymeleaf的判断表达式如下所示:
| themeleaf | 符号 | 备注 |
| gt | > | great than(大于) |
| ge | >= | great equal(大于等于) |
| eq | == | equal(等于) |
| lt | < | less than(小于) |
| le | <= | less equal(小于等于) |
| ne | != | not equal(不等于) |
例子:
<!--判断成绩-->
<td th:if="${test.Score} gt 0 and ${test.Score} lt 60">差</td>
<td th:if="${test.Score} ge 60 and ${test.Score} le 70">中</td>
<td th:if="${test.Score} gt 70 and ${test.Score} le 80">良</td>
<td th:if="${test.Score} gt 80 and ${test.Score} le 90">优</td>
<td th:if="${test.Score} gt 90 and ${test.Score} le 100">超级优秀</td>


被折叠的 条评论
为什么被折叠?



