generalized the table helper for easy use in other views