Fixed layout bug with tables in template