-my @chars = ((map {chr} ord '!' .. ord 'Z'), 'a'..'z');
-splice @chars, $_, 1, () for 2, 3-1, 5-2, 31-3; # remove character exceptions # $ & @
-print '<table>';
-print '<thead><tr><th> ';
-print "<th>$_" for @chars, '_';
-print '<tbody>';
-for my $c1 (@chars) {
- print "<tr><th>$c1";
- for my $c2 (@chars, '_') {
- my $mnem = $c1 . $c2;
- if (not defined $di->{$mnem}) {
- print '<td>';
- next;
- }
- my $chr = $di->{$mnem};
- my $glyph = chr $chr;
- utf8::upgrade($glyph); # prevent latin1 output
+for my $colchars (@columns) {
+print '<table class="glyphs dimap"><col>';
+print qq'<colgroup span="$_">' for map {scalar @$_} @{$colchars};
+say '</colgroup><col>';
+for my $section (qw{thead tfoot}) {
+ print "<$section><tr><th>↳";
+ print '<th>', EscapeHTML($_) for map {@$_} @{$colchars};
+ say '<th> ';
+}
+for my $c1group (@chars) {
+ print '<tbody>';
+ for my $c1 (@$c1group) {
+ print '<tr><th>', EscapeHTML($c1);
+ for my $c2 (map {@$_} @$colchars) {
+ my $mnem = $c1 . $c2;
+ if (not defined $di->{key}->{$mnem}) {
+ print '<td>';
+ next;
+ }
+ if (ref $di->{key}->{$mnem} ne 'ARRAY') {
+ printf '<td class="X Xr" title="%s">', EscapeHTML($mnem);
+ next;
+ }
+ my ($codepoint, $name, $support, $script, $string) =
+ @{ $di->{key}->{$mnem} };
+
+ my $glyph = $string || !!$codepoint && chr $codepoint;
+ utf8::upgrade($glyph); # prevent latin1 output
+ my $desc = $mnem . ($name && " ($name)");
+ my @class = ('X', grep {$_} $script);
+ push @class, $cmp ? $support :
+ $di->{flagclass}->{$support} // "u-$support" if $support;