Skip to content

Instantly share code, notes, and snippets.

@AitorAlejandro
Forked from davidgilbertson/tableMethods.js
Created July 15, 2018 21:56
Show Gist options
  • Save AitorAlejandro/7afaeeb530f47816461621cff89dec42 to your computer and use it in GitHub Desktop.
Save AitorAlejandro/7afaeeb530f47816461621cff89dec42 to your computer and use it in GitHub Desktop.
const tableEl = document.querySelector('table');
const headerRow = tableEl.createTHead().insertRow();
headerRow.insertCell().textContent = 'Make';
headerRow.insertCell().textContent = 'Model';
headerRow.insertCell().textContent = 'Color';
const newRow = tableEl.insertRow();
newRow.insertCell().textContent = 'Yes';
newRow.insertCell().textContent = 'No';
newRow.insertCell().textContent = 'Thank you';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment