remove code duplication, add th colspan

close #38