Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created March 18, 2014 22:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/9631608 to your computer and use it in GitHub Desktop.
Save isaacs/9631608 to your computer and use it in GitHub Desktop.
var red = '#c00'
var white = '#fff'
console.log('<table border=0 cellspacing=0 cellpadding=0 style="line-height:10px">\n' + ([
'111111111111111111',
'1 1 1 1',
'1 1 1 1 1 1 1 1',
'1 1 1 1 1 1 1 1',
'1 1 1 1 1 1 1',
'111111 1111111111',
' 1111 '
].map(function(row) {
return '<tr>' + (row.split('').map(function(c) {
var bg = (c === '1' ? red : white)
return '<td style="width:10px;height:10px;background:' + bg + '">&nbsp;</td>'
}).join('')) + '</tr>\n'
}).join('')) + '</table>')
@cyrusdavid
Copy link

Kewl!

How did you generate this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment