I have a table with three columns and two rows. I have this code which appends all data to just the first column. I know I am appending all the rows but I am not sure how to change it to add new columns instead.
var jdata = [];
$.getJSON(getURL(), function(json) {
jdata = json.items;
var menu = [];
$.each(jdata, function(key, val){
menu.push("<tr>");
menu.push("<td id=''"+key+"''>"+jdata[key].item_code+"</td>");
menu.push("<tr>");
menu.push("<tr>");
menu.push("<td id=''"+key+"''>"+jdata[key].dish_id+"</td>");
menu.push("<tr>");
});
$("<tbody/>", {html: menu.join("")}).appendTo("table");
});
this is what the result looks like:
