I want to add multiple classes using condition.
<div th:classappend="x.isTrue ?'class1' " ></div>
I want something like
<div th:classappend="x.isTrue ?'class1' and "y.isTrue ?'class2'" ></div>
I want to add multiple classes using condition.
<div th:classappend="x.isTrue ?'class1' " ></div>
I want something like
<div th:classappend="x.isTrue ?'class1' and "y.isTrue ?'class2'" ></div>
You can use literal substitutions to achieve this:
Another method is to simply wrap your conditions with brackets and concatenate them:
Try this solution. It works very well for me.