title: How to dynamically insert div in a table cell?
body: <p>I'm trying to add a div with a dynamic ID to a table cell.</p>
  
  <p>This is how I do it right now:</p>
  
  <pre><code>var ringNr = 1;
  function tableCreate(){
  alert('tableCreate');
  var newDiv = document.createElement('div');
  newDiv.id = "ring0" + ringNr;
  newDiv.style.height = "40px";
  newDiv.innerHTML = "Hello";
  
  $("#shoppingCart tbody").append(
      "&lt;tr&gt;"+
      "&lt;td&gt;"+this.appendChild(newDiv)+"&lt;/td&gt;"+ //This line creates the error
      //More cells to add
      "&lt;/tr&gt;");
  ringNr++;
  }; 
  </code></pre>
  
  <p>this.appendChild(newDiv) raises the following error: <code>Uncaught TypeError: Object [object global] has no method 'appendChild'</code></p>
  
  <p>How can I add this div to my table cell without errors?</p>