add table builder

Added code to build tables using FOR loops.