title: datatable re-order on deleting a row
body: <p>Im new to jquery. I have a table with only one row and a button to display initially. a new row is being added on click of a button and the row number in the td(serial number) is incremented. Now, when i delete the table, the number ordering will be missed. how to re-order the numbers on delete.</p>
  
  <pre><code>var i = 1; //adding the row 
  var k=1;
  $("#add_ExpenseRow").click(function() {
      $('.datepicker').datepicker('destroy');
      myTr = $("#expense_table tbody tr:first").clone(true);
      myTr.find("input[type='text']").val('');
      myTr.show();
      myTr.appendTo("#expense_table tbody");
      var x = $("#expense_table tbody tr").length-1;
      for(k; k&lt;x; k++){
          $("#expense_table tbody tr td:first").text(k+2);
      }
      //deleting the row
      $('#expense_table').delegate(".delRow",'click', function() {
          $(this).closest("tr").remove();
      });
  </code></pre>
  
  <p>Thanks</p>