I tried if object.qtdItem == 0
, then set the color to red for the TD:
<td th:style="${obj.qtdItem == 0 ? 'color: red;'}" th:text="${obj.text}"></td>
but this happened
error: Caused by:
org.springframework.expression.spel.SpelParseException: Expression
[perfil.qtdItem == 0 ? 'red'] @38: EL1044E: Unexpectedly ran out of
input
The ternary statement needs an else
clause e.g.
<td th:style="${obj.qtdItem == 0 ? 'color: red;' : 'color: some_other_color;'}}" th:text="${obj.text}"></td>