1

I am designing a thymeleaf template. I have a table row with data where I am using the below conditional code to colour its data. Any idea on how I can add other style elements such as padding and text-align to the table data 'td' tag ?

<td th:style="${Count < 1} ? 'color: green;' : 'color: red;' "
th:text="${count}"> Default Value</td>

Other Style attributes that I am trying to add to the above 'td' are as below :

style="padding: 6px; text-align: center;"

Please Note: I dont want to use a class and then refer the style attributes there. I am trying to inject it as in-line CSS.

jane
  • 211
  • 9
  • 30

1 Answers1

0

Incase someone bumps into a similar problem, I could solve it using : th:styleappend="'padding: 6px; text-align: center;'"

jane
  • 211
  • 9
  • 30