Reputation: 1378
Is there a way to tell Thymeleaf
to add parameters to a tag instead of overriding them?
Example:
<div class="a" th:class=${x ? 'b' : 'c'}>
Should result in either
<div class="a b">
or
<div class="a c">
Regards
Upvotes: 3
Views: 685
Reputation: 734
Another way to do this would be
th:attr="class=|a ${x ? 'b' : 'c'}|"
Upvotes: 6