Generate tables by js