Last active
November 2, 2015 13:36
-
-
Save maciejjankowski/f21c2ea0c087d9899184 to your computer and use it in GitHub Desktop.
this is how you converts array of arrays into tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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