-$_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
-
-my @table = do "writing-digits.inc.pl";
-die "Table data not found: <em>$_</em>.\n" for $! || $@ || ();
-
-$glyphs->print([map {
- ref $_ eq 'ARRAY' ? @{$_} : map { ".>$_" }
- $scriptname->{"digits_$_"} || $scriptname->{$_} || $_
-} @table]);
+$_ = showlink($_, "/latin") for $scriptname->{latn} || ();
+
+my $table = do "writing-digits.inc.pl";
+die "Table data not found: $_\n" for $@ || $! || ();
+
+sub printtable {
+ say '<div class=section>', $glyphs->tabletag;
+ for my $id (@_) {
+ my $info = $table->{$id};
+ my $title = $info->{title} // $scriptname->{$id} || $id;
+ print $glyphs->row([ ".>$title", @{$info->{list}} ]);
+ }
+ say '</table></div>';
+}