title: How to appendChild an array of object in a table?
body: <p>I have an array of objects, that I would like to add to my table.</p>
  <p>I am failing to understand how can I append this data to a table.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    var data = [{
        id: 12,
        data: 70,
        mama: "sjk"
      }, {
        id: 12,
        data: "mou",
        mama: "sjk"
      }, {
        id: 12,
        data: "mou",
        mama: "sjk"
      }]
  
      for (var i = 0; i &lt; data.length; i++) {
        var node = document.createElement("tr")
        var tb = document.createElement("td")
        var textnode = document.createTextNode(data[i].data);
        tb.appendChild(textnode);
        node.appendChild(tb)
        document.getElementById("myList1").appendChild(node);
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th data-field="id"&gt;Name&lt;/th&gt;
        &lt;th data-field="name"&gt;Item Name&lt;/th&gt;
        &lt;th data-field="price"&gt;Item Price&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
  
    &lt;tbody id="myList1"&gt;
  
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>