Javascript – How to iterate multiple arrays into table rows?
var MyArray = [['Cats', ['Lion','Tiger','Leopard']], ['Dogs', ['Wolf','Pug']], ['Reptiles', ['Snake','Gecko','Lizard','Triceratops']]]; var MyTable = document.getElementById("results"); const headerRow = document.createElement("tr"); MyTable.appendChild(headerRow); for(var i=0;i<MyArray.length;i++) { const newCell = document.createElement("th"); newCell.textContent = MyArray[i][0]; headerRow.appendChild(newCell); for (const datum of MyArray[i][1]) { const newRow = document.createElement("tr"); MyTable.appendChild(newRow);…