I have two arrays and need to write the data from both to two columns of a table. At this point I can write correctly data from the first array only and when I want to add the second array data, it gets added into rows.
orderGelen and userNameArr are my arrays. Here you can see my code:
for(let data of orderGelen){
dataHtmlIds += `<tr><td>${data}</td>`;
}
for(let usr of userNameArr){
dataHtmlUsr += `<td>${usr}</td></tr>`;
}
dataHtml = dataHtmlIds + dataHtmlUsr;
console.log(dataHtml);
And here I write that to table:
function tableConfig() {
tableBody.innerHTML = dataHtml;
}
How can I make the second column userNameArr data?