1

I got a table in my HTML and I want to generate new temporary HTML only with this table. How can I achieve it with HTML or JavaScript?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Kiman
  • 137
  • 2
  • 10
  • if someone is interested in results than: Table cloning used from nemo's answer, and for temporary HTML creation used [this](http://stackoverflow.com/questions/1750815/get-the-string-representation-of-a-dom-node) answer – Kiman Jul 03 '12 at 10:38

1 Answers1

2
var tempTable = document.getElementById("myTableId").cloneNode(true);

Where myTableId is the id of the table you want to clone. Then you can append your tempTable wherever you want(using appendChild )

nemo
  • 1,675
  • 10
  • 16