"Hello"
Bootstrap 3.0.3 Snippet by bruno93

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row clearfix"> <div class="col-md-12 column"> <table class="table table-bordered table-hover" id="tab_logic"> <thead> <tr> <th class="text-center"> # </th> <th class="text-center"> Name </th> <th class="text-center"> Mail </th> <th class="text-center"> Mobile </th> <th id='addrr1'></th> </tr> </thead> <tbody> <tr> <td> 1 </td> <td> <input type="text" name='name0' placeholder='Name' class="form-control"/> </td> <td> <input type="text" name='mail0' placeholder='Mail' class="form-control"/> </td> <td> <input type="text" name='mobile0' placeholder='Mobile' class="form-control"/> </td> <td id='addr1'></td> </tr> </tbody> </table> </div> </div> <a id="add_row" class="btn btn-default pull-left">Add Row</a><a id='delete_row' class="pull-right btn btn-default">Delete Row</a> </div>
$(document).ready(function(){ var i=1; var a=1; $("#add_row").click(function(){ $('#addrr'+a).html("<th>"+ (a+1) +"</th><th><input name='name"+i+"' type='text' placeholder='Name' class='form-control input-md' /> </th>"); $('#addr'+i).html("<td>"+ (i+1) +"</td><td><input name='name"+i+"' type='text' placeholder='Name' class='form-control input-md' /> "); $('#tab_logic').append('<td id="addr'+(i+1)+'"></td>'); $('#tab_logic').append('<th id="addrr'+(a+1)+'"></th>'); i++; }); $("#delete_row").click(function(){ if(i>1){ $("#addr"+(i-1)).html(''); i--; } }); });

Related: See More


Questions / Comments: