Table layout with javascript api