Is there a way to create a table with different colors using Thymeleaf? I have a list of events with risk weights represented by integer values. Each column in the HTML table should be colorized based on certain conditions. For example, if the risk is less than 20, it should be green, if the risk is between 20 and 50, it should be yellow, and if the risk is over 50, it should be red. How can I set multiple conditions for one column? The solution I have tried so far doesn't seem to be working.
<td th:text="${data.riskIndex}" th:if="${data.riskIndex < 20 and data.riskIndex >= 0}" class="green"></td>