I have my html table which appends row to the last row using jquery for example
how I want it
row1>> Just posted
row2>> posted 1min before
row3>> posted 2 min before
But it shows like
row1>> posted 2 min before
row2>> posted 1min before
row3>> Just posted
<tbody>
<table align="center" style="width:auto" id="ex-table">
<tr id="tr">
<center><th>Date of join</th></center>
<center><th>name</th></center>
<center><th>designation</th></center>
<center><th>exprience</th></center>
<center><th>salary</th></center>
</tr>
</table>
</tbody>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
var database = firebase.database().ref().child('user');
database.on('value', function(snapshot){
if(snapshot.exists()){
var content = ' ';
snapshot.forEach(function(data){
var val = data.val();
content +='<tr>';
content += '<td>' + val.daeofjoin + '</td>';
content += '<td>' + val.name + '</td>';
content += '<td>' + val.designation + '</td>';
content += '<td>' + val.experience + '</td>';
content += '<td>' + val.salary + '</td>';
content += '</tr>';
});
$('#ex-table').append(content)
}
});
</script>