title: InsertAfter() fail on empty table
body: <p>I have a function that transfert row from a table to another table, and vice versa.
  This works well but when the table is empty, the fucntion doesn't work anymore.</p>
  
  <pre><code>//fonction deplacement du tableauAvant au tableauApres
  $(document).ready(function(){
      $('.table-bougesurApres').click(function (e) {
                   $('#table1 tr.selected').insertAfter('#table2 tbody tr:last-child');
      })
  })  
  
  
  //fonction deplacement du tableauApres au tableauAvant
  $(document).ready(function(){
      $('.table-bougesurAvant').click(function (e) {
                   $('#table2 tr.selected').insertAfter('#table1 tbody tr:last-child');
      })
  })  
  </code></pre>
  
  <p>Here is the fiddle <a href="https://jsfiddle.net/Ln7o4vzs/" rel="nofollow noreferrer">https://jsfiddle.net/Ln7o4vzs/</a> </p>