Moved the js code from the table.html to table.js