I want to write some JavaScript to create a simple HTML table from an array that just contains numbers:
var array = [1,2,3,4,5,6,7,8,9,10];
var array = [1,2,3,4,5,6,7,8,9,10]; var result = ""; result += ""; for (var j = 0; j < array.length; j++) { result += "" + array[j] + ""; if ((j + 1) % 5 == 0) { result += ""; } } result += ""; result += ""; document.body.innerHTML = result;
Please give it a try if that works