Skip to content

Instantly share code, notes, and snippets.

@vladzadvorny
Created May 16, 2017 13:54
Show Gist options
  • Save vladzadvorny/86b35ac4a2368bf744b118977e114e9c to your computer and use it in GitHub Desktop.
Save vladzadvorny/86b35ac4a2368bf744b118977e114e9c to your computer and use it in GitHub Desktop.
(function () {
var table = document.createElement('table');
for (var i = 0; i < 42; i++) { //24
var row = table.insertRow(i);
for (var j = 0; j < 42; j++) {
row.insertCell(j);
}
}
document.querySelector('.display').appendChild(table);
})();
var getPixel = function (x, y) {
return document.querySelector(`.display table tr:nth-child(${y + 1}) td:nth-child(${x + 1})`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment