-2
I’m using append to generate my table, but each row is being generated by a ForEach
, but now that I have managed to generate the first column I have no idea how to generate the other
let TrackerList = document.getElementById('TrackerList');
firebase.database().ref('users').on('value', function (snapshot) {
TrackerList.innerHTML += '';
snapshot.forEach(function (item) {
item.forEach(function (navigation) {
result = navigation.val();
result.map((resultado, index) => {
var tr = document.createElement('tr');
var td = document.createElement('td');
td.appendChild(document.createTextNode(resultado.params['campaign']))
tr.appendChild(td);
TrackerList.appendChild(tr);
console.log(resultado)
})
})
})
})
<table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
<thead>
<tr>
<th>Campanha</th>
<th>Canal</th>
<th>Tráfego</th>
<th>Vendas</th>
<th>Conversão</th>
<th>LandingPage</th>
</tr>
</thead>
<tbody id="TrackerList">
</tbody>
</table>
This is the Stack Overflow in Portuguese translate your question or ask Soen
– Costamilam