title: Dynamically create div inside table using jQuery?
body: <p>I am creating a div dynamically in jQuery as mentioned in the below code appending to the form.  </p>
  
  <pre><code> var temp = document.createElement("div");
       temp.setAttribute("id", "test");
  </code></pre>
  
  <p>Form:</p>
  
  <pre><code>&lt;form id="test1" method="get"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I am trying to have a table created dynamically and need to have this inside a table?</p>
  
  <p>To form table dynamically:</p>
  
  <pre><code> var tableHeader = '&lt;table border="1"&gt; &lt;thead&gt; &lt;tr&gt;&lt;th&gt;QueryName&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Modified Date&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;';
   $("#test").prepend(tableHeader);
  </code></pre>
  
  <p>Now I need to have <code>&lt;td&gt;</code> (Which I need to create) inside which I need the div element I created. Like this:</p>
  
  <pre><code>&lt;table&gt;
  ...
  ....
  &lt;tr&gt; 
  &lt;td&gt;
  &lt;div id="test"&gt;   // Div  i created dynamically in the top(1st line)
  &lt;/div&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>How do I achieve this in jQuery? </p>