- print '<table class="glyphs">';
- print ref $_ ne 'ARRAY' ? "<tr><th>$_" : map {"<td>$_"} @$_ for @table;
- print "</table>\n\n";
+ say '<table class="glyphs">';
+ for my $row (pairs @table) {
+ my ($title, $cells) = @{$row};
+ printf '<tr id="%s">', (lc $title) =~ s/<[^>]+>//gr =~ s/\s+/-/gr;
+ say '<th>', $title;
+ print /^<td/ ? $_ : "\t<td>$_\n" for @{$cells};
+ }
+ say "</table>\n";