Right now I cannot figure out how to add headers for all the columns in this code where a html-table are created dynamically
function createTableAndInsert(sqlArray) { //create table dynamically - only one row by the moment var table = document.createElement('table'); for (var i = 1; i < 2; i++) { var tr = document.createElement('tr'); // row for (var j = 0; j < 8; j++) { var td = document.createElement('td'); //column var text = document.createTextNode(sqlArray[j]); //cell td.appendChild(text); tr.appendChild(td); } table.appendChild(tr); } document.getElementById('single_fine_view').appendChild(table); }