I am trying to update a table according to ajax respond. My update should be insert as the first row inside It is because your appending the data, you should use .html(data) then it will be replaced by your new data use here the solution for you OLD : NEW : You need to use prepend at the place of append Try this. check my fiddle : http://jsfiddle.net/W4gYY/3/ If you declared thead then you can use If your html look like below : then you can use otherwise without There is a jQuery method called after() and it can do the thing you want... can be changed to in my table. With my coding this is ha
html
instead of append
success: function(data) {
$('#manage_user table > tbody:first').html(data);
//alert(data);
}
$('#manage_user table > tbody:first').append(data);
$('#manage_user table > tbody').prepend(data);
$('#manage_user table > tbody:last').find('tr:first').before(data);
tbody:first
and working fine. You do not mention thead
that is way html treated as default tbody
<div id="manage_user">
<table>
<thead>
<tr>
<th><input type='checkbox' class='selectAll' name='selectAll' value='' /> Name</th>
<th>Address</th>
<th>City</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type='checkbox' name='' value='' class='' /> sdfsdfs</td>
<td>dsfs</td>
<td>dsfdsf</td>
<td><span class='edit_ico'></span></td>
<td><span class='delete_ico'></span></td>
</tr>
<tr>
<td><input type='checkbox' name='' value='' class='' /> aaaaaaa</td>
<td>dfsdf</td>
<td>dsfsf</td>
<td><span class='edit_ico'></span></td>
<td><span class='delete_ico'></span></td>
</tr>
</tbody>
</table>
</div>
$('#manage_user table > tbody:first').find('tr:first').before(data);
thead
in html you have to do following code $('#manage_user table > tbody:last').find('tr:first').before(data);
$('#manage_user table > tbody:first').append(data);
$('#manage_user tr:first').after('<tr><td>first</td></tr>');
which inserts the result as first row of the table... Check the demo here