Copy the content of one HTML table into another using JavaScript Revisited
I'm teaching myself JavaScript and I need to copy one table into another. I've been able to reproduce @Gushiken's code and @Quentin's response with this example: HTML: <button onclick="copytable()">Copy Table</button> <br /> <br /> <table id="TableA"> <!--<tbody></tbody>--> </table> <br /> <table id="TableB" style="border:solid"> <thead> <tr> <td id="col1">Column 1</td> <td id="col2">Column 2</td> <td id="col3">Column 3</td> </tr> </thead> <tbody> <tr> <td>Data a</td> <td>Data b</td> <td>Data c</td> </tr> </tbody> </table> <br /> JavaScript: function copytable() { var source = document.getElem
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.