I have a following html structure
<thead class="table-header">
<tr>
<th><div class="th-inner">a</th>
<th><div class="th-inner">b</th>
<th><div class="th-inner">c</th>
</tr>
</thead>
And I want to add div with class th-but right next to div th-inner based on simple data array with three elements (mydata=['x', 'y', 'z']).
I tried following but it doesn't seem to work:
cells = d3.select('root').select('thead.table-header tr')
.selectAll('div.th-inner').data(mydata)
.selectAll('div.th-but').data(function(d,i){return d;});
cells.enter().append('div').classed('th-but', true);
Am I missing something? Am I going in right direction with solution?
root?