title: how to use javascript or jquery create table fast
body: <p>I want to create a table by click a button,and i need to save the table to the database .this is the code to create table but i think this is so long,how can i create it fast?</p>
  
  <pre><code>var div = document.createElement("div");
          var table1 = document.createElement("table");
          var table2 =document.createElement("table");
          var thead = document.createElement("thead");
          var th1 = document.createElement("th");
          var th2 = document.createElement("th");
          var th3 = document.createElement("th");
          th1.innerHTML="Count";
          th2.innerHTML="Date";
          th3.innerHTML="Price";
          document.body.appendChild(div);
          div.appendChild(table1);
          div.appendChild(table2);
          table2.appendChild(thead);
          thead.appendChild(th1);
          thead.appendChild(th2);
          thead.appendChild(th3);
  </code></pre>