prepend and append

prepend and append


Below is the :success portion of an AJAX request. 
The problem is I want to affix the tblEnd string  ( </table>  )
to the end of the #response div,  after the last tr, and it is not doing that.

 I got the tblHdr ( <table>) string added above the first <tr> but for some reason I can't get
the closing </table> tag added to the end of the #response div?   Is the prob the selector?
thanks,


success: function(data) {
var checkbx ='<input type="checkbox" class="checkall">';
var tblHdr = '<table class="table">';
tblHdr +="<tr> <th>Todo Item</th><th>Task Assigned To</th><th>Date Due</th></tr>";
var delRow = '<input type="button"  class="btnDelete"   onclick="deleteRow(this)">';
    var tblEnd = "</\table>";
var rows= ''; 
$.each(data, function(idx,item) {
rows+= '<tr><td>'+checkbx +item.todo +'<\/td><td>'+item.name+'<\/td><td>'+item.date + delRow + '<\/td><\/tr>';
$("#response").append(rows);     *** 
});//end  each
$("#response").prepend(tblHdr);     ****
   $('#response tr:last').append(tblEnd);   ***
} //end success   

Again, the first append(rows)   is working but not the last append(tblEnd)?

thanks,