- my $html = tidy_up(open_table(\%params, $header),
- build_rows(\%params, @data),
- close_table(\%params, $header));
+ my @lines;
+ push @lines, defined $params{class}
+ ? "<table class=\"".$params{class}.'">'
+ : '<table>';
+ push @lines, "\t<thead>",
+ genrow(\%params, "th", @$header),
+ "\t</thead>" if defined $header;
+ push @lines, "\t<tbody>" if defined $header;
+ push @lines, genrow(\%params, "td", @$_) foreach @data;
+ push @lines, "\t</tbody>" if defined $header;
+ push @lines, '</table>';
+ my $html = join("\n", @lines);