Skip to content

Instantly share code, notes, and snippets.

@TheTomster
Last active August 29, 2015 14:06
Show Gist options
  • Save TheTomster/4893d5caf87f7061461f to your computer and use it in GitHub Desktop.
Save TheTomster/4893d5caf87f7061461f to your computer and use it in GitHub Desktop.
t = table ->
@head 'item', 'price', 'qty'
for thing in shop
@row thing.name, thing.price, thing.qty
var t;
t = table(function() {
var thing, _i, _len, _results;
this.head('item', 'price', 'qty');
_results = [];
for (_i = 0, _len = shop.length; _i < _len; _i++) {
thing = shop[_i];
_results.push(this.row(thing.name, thing.price, thing.qty));
}
return _results;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment