Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
There are various ways to do this in jQuery.  One quick thing you can try out is the below code.  But do work with it and tune this for your requirement..(I have just quickly typed this.. you may consider other approaches like individually creating TR/TD elements and adding it).

Assuming table has ID (you can change this)...

http://jsbin.com/emipuj/1/


H
ope this helps..
$(function () {
  $("#btnAdd").on("click", function (e) {
    $('#table1 tbody>tr:last').clone(true).insertAfter('#table1 tbody>tr:last');
    $('#table1 tbody>tr:last td').each(function (i,td) {
        $(td).text("some value");
    });
  });
});

 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <table id="table1" border="1">
    <thead>
      
      <tr><th>First Name</th>
      <th>Last Name</th></tr>
    </thead> 
    <tfoot>
        <tr><td colspan="2">Constituents</td></tr>
    </tfoot>
    <tbody>
        <tr><td>Rakesh</td><td>Srinivasi</td></tr>
        <tr><td>Andy</td><td>Allison</td></tr>
    </tbody>
</table>
  
  <input type="button" value="Add Row" id="btnAdd"/>
</body>
</html>

 
Rajesh Pillai, Apr 17, 2013
thanks for your response , I want to create a custom menuhandler with composite pattern which will render menu to jquery menu on asp.net, Is it possible ,or if it is possible is there be a performance problem ?
Jan 25, 2012
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas