Skip to content

Instantly share code, notes, and snippets.

@jsrath
Last active October 15, 2018 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsrath/3302eb2124615e51a2a22183a3cd1063 to your computer and use it in GitHub Desktop.
Save jsrath/3302eb2124615e51a2a22183a3cd1063 to your computer and use it in GitHub Desktop.
const tableContainer = document.getElementById('tableContainer');
let resultsTableBody = document.createElement('tbody');
for (let i = 0; i < allBoxes.length; i++) {
let row = document.createElement('tr');
for (let j = 0; j < 8; j++) {
let cell = document.createElement('td');
let cellText = document.createTextNode(goalArray[i][j]);
cell.appendChild(cellText);
row.appendChild(cell);
}
resultsTableBody.appendChild(row);
}
tableContainer.appendChild(resultsTableBody);
let winner = document.getElementById('winner');
winner.innerText = document.querySelector('tr:first-child td:first-child').innerText;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment