【一】三元运算符select中:<select class=“form-control” id=“mt” name=“noticetype”> <option value=“0”>–请选择–</option> <option th:each = “noticetype : ${noticetypeList}” th:selected="${noticetype.id} eq ${noticemodel.noticetype} ? true : false" th:value = “${noticetype.id}"> <span th:text="${noticetype.name}"></span> </option> </select>class中<a href=”/" th:class="@{(${category} eq ‘home’ ? ‘active-class’ : ‘’)}" class=“active-class”>首页</a>text中<td th:text="${bidAnnounceDO.f eq 1 ? ‘已发布’ : ‘未发布’"}></td>//如果有多个用()括起来,如:<td th:text="${bidAnnounceDO.f eq 1 ? ‘已发布’ : (${bidAnnounceDO.f} eq 2 ? ‘考虑中’ : ‘未发布’’’)}"></td>【二】多条件判断 th:if="${bidSuppreDO.result eq 0 && bidSuppreDO.f eq 0}"【三】关系运算符 gt:great than(大于)> ge:great equal(大于等于)>= eq:equal(等于)== lt:less than(小于)< le:less equal(小于等于)<= ne:not equal(不等于)!=