I need to add rows to a table dynamically when the command was given by the user to add them to the end of a printed rows. But the number of columns must add for a particular row vary by table to table.
The number of columns should add is getting dynamically to each table. So the printed number of columns must vary time to time. This is the code I used.
$(document).ready(function(){
$("#anc_add").click(function(){ //This is the ID of the button where user gives the command to add rows.
var Total=$("#NumberOfColumns").val(); //This is the number of input boxes I must add to that row......
$('#tbl1 tr').last().after(
'<tr><td>Static Content ['+cnt+']</td><td><input type="text" name="txtbx'+cnt+'" value="'+cnt+'">;
); // I need to print the given(Total) number of input boxes instead of printing textboxes like this.
cnt++;
});
});
Could anyone please suggest me a way to do this. Thank you so much.