I am trying to show a HTML table populated from JSON values received using AJAX call. This is the HTML and JQuery Script:
<div id="content"></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script>
$(document).on("ready", function(){
loadData();
});
var loadData = function(){
$.ajax({
type:"POST",
url:"http://****/current_batch_jrz.php"
}).done(function(data){
console.log(data);
$("#content").append( "<table class='table'><caption> BATCH IN JUAREZ</caption><thead><tbody><tr><th>CLIENTE</th><th>CERTIFICADO</th><th>PRODUCTO</th><th>LOTE</th><th>FECHA</th><th>FLUJO TREN A</th><th>VOLUMEN TREN A</th><th>FLUJO TREN B</th><th>VOLUMEN TREN B</th><th>VOLUMEN TOTAL</th></tr>");
var users = JSON.parse(data)["data"];
for(var i in users){
$("#content").append("<tr><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td><td>"+users[ i ][0]+"</td></tr>");
}
$("#content").append( "</tbody></table>");
});
}
</script>
The table columns header is shown as desired, but the row is not shown properly, all values are shown together as you can see in the screenshot:

dataType: 'json'in the.ajaxcall?