I am having an HTML table and I need to change it contents.
<div id='adf'>
<table id='tbl1' runat='server' >
<tr><td></td></tr>
</table>
</div>
I am changing the contents using a jQuery Ajax and the problem is that I am accessing the same table with same name after that. So I am changing the HTML content and inserts new HTML of a table will adds a new table. So I need to remove the table rows and add the results to the table. So there will be no change in the contents. Thanks in advance.
If I understand you correctly, use the html() function to change the contents after you’ve run the ajax call.
As a efficiency tip, make sure you load all the changes into a string and just call html() once at the end. Otherwise, you’ll find your page to be extremely slow.
If you are just adding new rows, use append().
http://api.jquery.com/append/
It shouldn’t matter that the table has the same name. Just grab it by its identifier.