add codes for build table