create one general generic buildTable Method