added support for tables in template