Skip to content Skip to sidebar Skip to footer

JSON Data To HTML Table With JQUERY

Someone knows how i can send all the values of the 'User' object in my JS file ('User 1' for example) to the header of my HTML Table? I will only put one column structured by JSON

Solution 1:

If I've understand correctly: Javascript and Jquery will do the job..

var text = "";
for (i=0;i<dataX.length;i++) {

   text += "<tr>";
   text += "<td>"+ dataX[i].Name +"</td>";
   text += "<td>"+ dataX[i].Role +"</td>";
   text += "<td>"+ dataX[i].Age +"</td>";
   text += "<td>"+ dataX[i].skillsTable2[0] +"</td>";
   text += "<td>"+ dataX[i].bioPicURL +"</td>";
   text+= "</tr>";

}
$("#tableBox").append(text);

Post a Comment for "JSON Data To HTML Table With JQUERY"