Simple JS code to draw and modify html tables