|
<tr th:class="${row.even}? (${row.first}? 'first' : 'even') : 'odd'"> |
The first row checking ternary needs to be on the odd half of the even checking ternary rather than the even.
1 is odd so row.even will evaluate to false and then be set to "odd".
There is no way for the "first" to ever be returned.
Proposed refactor:
<tr th:class="${row.first}? 'first' : (${row.even} ? 'even' : 'odd')">
thymeleaf-docs/docs/tutorials/2.1/usingthymeleaf.md
Line 1433 in 3611e89
The first row checking ternary needs to be on the odd half of the even checking ternary rather than the even.
1 is odd so
row.evenwill evaluate tofalseand then be set to"odd".There is no way for the
"first"to ever be returned.Proposed refactor:
<tr th:class="${row.first}? 'first' : (${row.even} ? 'even' : 'odd')">