how to loop generate a html line to each object in a list

I need to create a table where each loop will populate the columns in an html table
obs. the parameter received in onSuccess function is a xml return

function onSuccess(data) {     var table = document.getElementBdyId("kaizens")     var lstProjetos = data.d.results;     $.each(lstProjetos, function (key, value) {         $("#head").append("</th>"+value.Area+"</th>");     });                                  

Html:

<div class="mytable">     <table class="table" id="kaizens">         <tr id="head">             <th>teste</th>         </tr>         </table> </div>  
Asked on July 16, 2020 in HTML,   XML.
Add Comment
1 Answer(s)

</th> should be <th> without the /. because balise should be open without the / and close with

function onSuccess(data) {     var table = document.getElementById("kaizens")     var lstProjetos = data.d.results;     $.each(lstProjetos, function (key, value) {         $("#head").append("<th>"+value.Area+"</th>");     });   
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.