0 votes
66 views
asked in HTML by (4.2k points)
edited by
hi

   in my case i read all the data from my server i want populate those data in table runtime?

1 Answer

0 votes
answered by (8.2k points)

Try this:

HTML

<table id="datatable">
       <tr>
        <td><input type="text"  /></td>
       </tr>
       <tr>
        <td><input type="text"  /></td>
       </tr>
     </table>

<button type="button" id="add" onclick="addRow('dataTable')">
        <b>Add</b>
 </button>
JS

 $(document).ready(function() {
    $('#add').click(function(){
        $('#datatable').append(' <tr> <td>Account No</td> <td>:</td> <td colspan="2"><input size="20" type="text" /></td> <td>Bill No</td> <td>:</td> <td><input type="text" /></td> </tr> <tr> <td>Name</td> <td>:</td> <td colspan="2"><input type="text" /></td> <td>Bill date</td> <td>:</td> <td><input type="text" /></td> </tr>');
});
});
Fiddle: http://jsfiddle.net/zLXmQ/4/

Categories

...