When i got the data from firebase , all child go into one table. but i want every child in a new table.
here is what i have done :
<table border="1" style="height: 63px; width: 31%; border-collapse: collapse; color: #0a0606; background-color: #ffffff; background-position: center center; border-radius: 100; border: 200 solid;">
<thead>
<tr>
<td>Title</td>
<td >Description</td>
<td >Link</td>
</tr>
</thead>
<tbody id="data">
</tbody>
</table>
var userDataRef = firebase.database().ref("User/3N2f2rJSSAZmFOdZEeJdlsuEZam2").orderByKey();
userDataRef.on('child_added', function(childSnapshot) {
var key = childSnapshot.key;
console.log(key);
var childData = childSnapshot.val();
var title_val = childData.Title;
var url_val = childData.Url;
var dec_val = childData.Descreption;
$("#data").append("<tr><td>" + title_val + "</td><td>" + dec_val + "</td><td>" + url_val + "</td></tr>");
});
i tried many things but always the result in the same table ..
Aucun commentaire:
Enregistrer un commentaire