title: how to hide the table if there is no data and show the form using jquery or javascript
body: <p>Iam getting the records in tabular format and displaying the data in front end but if there is no data i need to hide total table including table headings.here is my code.</p>
  
  <pre><code>&lt;table style="width:87%;"&gt;
      &lt;tr class="spaces"&gt;
          &lt;th&gt;S.No.&lt;/th&gt;
          &lt;th style="width:20%;"&gt;Rent Earned&lt;/th&gt;
          &lt;th&gt;House&lt;/th&gt;
          &lt;th&gt;Address of Property&lt;/th&gt;
      &lt;/tr&gt;
      &lt;?php include "rentaldetails.php";
          while($row = mysql_fetch_array($result))
          {?&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;?php echo $row['house_details_id'];?&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;?php echo $row['rental_annual_rent'];?&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;?php echo $row['rental_tax_paid'];?&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;?php echo $row['rental_town'];?&gt;
          &lt;/td&gt;
          &lt;td style="width:21%;"&gt;&lt;a class="button add" onClick="document.location.href='income_tax.php'"&gt;Edit Details&lt;/a&gt;&lt;/td&gt;
          &lt;td style="width:21%;"&gt;&lt;a class="buttons delete" href="deleterental.php?id=&lt;?php echo $row['house_details_id'];?&gt;" onclick="return confirm('Are you sure to delete');" class="table-icon delete"&gt;Delete Property&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;?php
       }
      ?&gt;
  &lt;/table&gt;
  &lt;form method="POST" action="details.php"&gt;
  &lt;th&gt;Address Line&lt;/th&gt;
  &lt;td&gt;&lt;input type="text" name="address" value=""  /&gt;&lt;/td&gt;
  &lt;th&gt;Town/City&lt;/th&gt;
  &lt;td&gt;&lt;input type="text" name="city" value="" /&gt;&lt;/td&gt;
  &lt;button type="submit"  class = "medium" style="background-color: #a9014b;float:left;"&gt;Save&lt;/button&gt;
  </code></pre>
  
  <p>I need to hide these total table if there is no data in database and should display the form.</p>