if $a[0] has rowspan=2 then we have to place one empty in the corresponding place of $a[1] if rowspan=3 the we have to place empty in $a[1] and $a[2] in corresponding place.