title: How to hide parent div if tr is empty with thymeleaf?
body: <p>I am using the thymeleaf framework. I wanted to hide the whole div if values are coming out as empty. and show if it's not null.</p>
  
  <p><strong>Html code</strong></p>
  
  <pre><code>&lt;div&gt;
  &lt;h2&gt; My Table &lt;/h2&gt;
      &lt;table border="1"&gt;
          &lt;tr bgcolor="powderblue"&gt;
              &lt;th&gt;name&lt;/th&gt;
              &lt;th&gt;age&lt;/th&gt;
              &lt;th&gt;hobby&lt;/th&gt;
              &lt;th&gt;interest&lt;/th&gt;
              &lt;th&gt;books&lt;/th&gt;
              &lt;th&gt;movie&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr th:each="table: ${myTable}"&gt;
  
          &lt;td th:text = "${table.name != null ? table.name : 'NULL'}" /&gt;
          &lt;td th:text = "${table.age != null ? table.age : 'NULL'}" /&gt;
          &lt;td th:text = "${table.hobby != null ? table.hobby : 'NULL'}" /&gt;
          &lt;td th:text = "${table.interest != null ? table.interest: 'NULL'}" /&gt;
          &lt;td th:text = "${table.books != null ? table.books : 'NULL'}" /&gt;
          &lt;td th:text = "${table.movie != null ? table.movie : 'NULL'}" /&gt;
  
          &lt;/tr&gt;
          &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I hide this div when "tr th:each="table: ${myTable}" is not displaying any values? It does not have to be strictly thymeleaf function. I can use angularjs functions if possible.</p>
  
  <p><strong>Confusion</strong></p>
  
  <p>I was thinking to do something like if tr tag is null hide div. But my first tr tag wouldn't be null since it is static.</p>
  
  <p><strong>Output</strong></p>
  
  <pre><code>My Table
  |name | age | hobby | interest | books | movies |
  |     |     |       |          |       |        | 
  </code></pre>
  
  <p>How can I hide the whole if the values are null/empty? Table values varies and obtained by a database. Sometimes can be blank sometimes has values</p>