Skip to content

Instantly share code, notes, and snippets.

@maciejjankowski
Last active November 2, 2015 13:36
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 maciejjankowski/f21c2ea0c087d9899184 to your computer and use it in GitHub Desktop.
Save maciejjankowski/f21c2ea0c087d9899184 to your computer and use it in GitHub Desktop.
this is how you converts array of arrays into tables
function tabelajzing(a){
return ["<tr>\n<th>",
a.map(function (e, i) {
return e.join("</th>\n<td>")
}).join("</td></tr>\n<tr>\n<th>"),
"</td>\n</tr>\n"
].join("")
}
var yourHtml = function () {
return tabelajzing([
["header 1", "value 1"],
["header2" , "value 2"]
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment