Your code isn't working because .addEventListener should be given the event name without the 'on' part.
document.getElementById("submit").addEventListener("click", createTable, false);
Another problem is that you are using a submit button, which reloads the page unless you prevent that action. Because you're not submitting to a server, I would just change it to a regular button.
You also have a typo in this line: