Currently I am using thymeleaf as a view. I am trying to hide my div if all of my table tags are null or empty. If it is not empty then show the div that will show the table.
Simple Html :
<div id= "myTable1div">
<h3> Test table </h3>
<table id="Table1">
<thead>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr th:each="data, iterStat : ${hostlist}">
<td th:text = "${data.host}"></td>
<td th:text = "${data.id}"></td>
<td th:text = "${data.number}"></td>
</tr>
</tbody>
</table>
</div>
How can I write a javascript, css or Jquery if td is null hide this div? Basically this would show a table with a header. But if the tags are null it should be just a blank page. Showing nothing that is inside the tag.