I want to create an update table with a button, but the button is not show in the row. please help me to add the button to the table. thanks.
function addRow(){
var ref = firebase.database().ref();
ref.on("value", function(snapshot) {
numPhotos=snapshot.child("La_Cartelera").child("ok").val();
})
var realNumPhotos=numPhotos-1;
for(var i =1; i<realNumPhotos; i++){
var ref = firebase.database().ref();
ref.on("value", function(snapshot) {
board=snapshot.child(i).child("Board").val();
imageChild=snapshot.child(i).child("Image").val();
})
console.log(i);
console.log(board);
rowNum = realNumPhotos-i;
var btn = document.createElement("BUTTON");
btn.innerHTML = "Confirm";
document.body.appendChild(btn);
var table = document.getElementById("myTable");
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
cell1.innerHTML = rowNum
cell2.innerHTML = board
cell3.innerHTML = imageChild
cell4.innerHTML = btn
}
}
