sub col { my ($tab,$opt) = @_; my @attributes; push @attributes, qq(class="$opt->{class}") if $opt->{class}; push @attributes, qq(span="$opt->{span}") if $opt->{span}; my $format = @attributes > 0 ? ' '.join(' ',@attributes) : ''; my $tag = 'col'.$format; line($tab,qq(<$tag>)); } sub cols { my ($tab,$cols) = @_; col($tab,$_) for @{$cols}; }