add table delegate code