title: Insert child elements in d3.js
body: <p>I am trying to create a table using D3.js, but td elements are not nesting inside the tr.</p>
  
  <p>This is what I am trying to create:</p>
  
  <pre><code>        &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;Name&lt;/td&gt;
                  &lt;td&gt;Value&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>
  
  <p>This is what I've tried:</p>
  
  <pre><code>    var myTable = d3.select("#myTable")
  
      var myTableRow = myTable.selectAll("tr")
          .data(myData);
  
      myTableRow.enter()
          .append("tr")
          .insert("td", ":first-child")
          .html(function(d) {
              return d.name;
          })
          .insert("td", ":first-child")
          .html(function(d) {
              return d.value;
          });
  </code></pre>
  
  <p>However, each td does not nest inside the tr.</p>