building tables from structure