title: Deleting rows from a table
body: <p>I have a Table where a User can delete rows </p>
  
  <p>While deleting , If there is only one row present, 
  I need to remove the Erase Button dynamically </p>
  
  <p>So that User cannot delete all the rows </p>
  
  <p>I have tried as following </p>
  
  <pre><code>$(".butnBorrar").click(function(event){
  
     if($("#MyTable tr").length==2)
     {
      $(this).find('td:last-child').remove();
     }
     else
     {
    $(this).closest('tr').remove();
    }
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/44avhkas/33/" rel="nofollow noreferrer">https://jsfiddle.net/44avhkas/33/</a></p>
  
  <p>Could you please let me know how to do this ? So that for the last row The Erase Button will be removed dynmaically </p>