title: How can I apply style to a div based on condition in thymeleaf?
body: <p>I have a <code>&lt;div&gt;</code> block which I need to set to <code>display:none</code> or <code>display:block</code> based on the condition. The html looks like this,</p>
  
  <pre><code>&lt;div style="display:none;"&gt; 
      //some html block content
  &lt;/div&gt;
  </code></pre>
  
  <p>I've tried the following code in thymeleaf,</p>
  
  <pre><code>&lt;div th:style="${condition} == 'MATCH' ? display:block : display:none"&gt; 
      //some html block content
  &lt;/div&gt;
  </code></pre>
  
  <p>But the above expression is not working. throws <code>org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression:</code> error message. </p>
  
  <p>I can do <code>th:classappend</code> to set some class and make this work but want to know if elvis/ternary operator will support on thymeleaf <code>th:style</code> tag.</p>