move to helper, expand logic and css

move Class from Element to Helper.

do deeper analysis of xx and yy headers to calculate rowspan/colspan condition