I'm trying to make a table of emojis and made a foreach loop to make a table:
emojis = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '⚡', '✊', '✋', '✌', '✍', '❤', '⭐']
var i = 0
document.getElementById("emojiTable").innerHTML += "<table><tr>"
emojis.forEach(emoji => {
if(i == 12) {
document.getElementById("emojiTable").innerHTML += "</tr><tr>"
i = 0
}
document.getElementById("emojiTable").innerHTML += "<td>"+emoji+"</td>"
i ++
})
document.getElementById("emojiBAR").innerHTML += "</table>"
My problem is that when i run the code instead of getting a 12 x 6 table i get this weird piece of HTML:
<table><tbody><tr></tr></tbody></table>⚡✊✋✌✍❤⭐
I have no idea what is causing this. How can i fix this?