You need to indicate that all cells must be cloned.
The funcCloneRow function will clone the string (tr) and add the contents of the tdKeyArr cell. Remember that "tdKeyArr" is an array containing the selected cell position, for example:
$(function() { var funcCloneRow = function($table1, $table2, trIndex, tdKeyArr) {
table { float:left; margin-right:100px; border-collapse:collapse; text-align:center; vertical-align:top; } table th, table td { border:1px solid #000; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <body> <table id="table1"> <tr> <th>head 1</th> <th>head 2</th> <th>head 3</th> </tr> <tr> <td>row 1</td> <td>row 1</td> <td><button>Append</button></td> </tr> <tr> <td>row 2</td> <td>row 2</td> <td><button>Append</button></td> </tr> <tr> <td>row 3</td> <td>row 3</td> <td><button>Append</button></td> </tr> </table> <table id="table2"> <tr> <th>head 1</th> <th>head 2</th> <th>head 3</th> </tr> </table> </body>
source share