- if (@draw) {
- my $width = scalar @{ $table->[0] };
- my @imgpal = map {
- [ ref $_ ? @{$_}[1 .. 3] : map {hex} /(..)(..)(..)/ ]
- } map { @{$_} } @{$table};
- for (@draw) {
- print "<tr><td colspan=$width>", img_egapal(\@imgpal, @{$_});
+ if (my $table = $info->{table}) {
+ $table = [ @{$table}[@{$reorder}] ] if $reorder;
+
+ for my $row (@$table) {
+ if (!$row) {
+ say '<tbody>';
+ next;
+ }
+ print '<tr>';
+ print colcell(ref $_ ? @$_ : $_ ? reverse split /:/ : undef) for @$row;
+ }
+
+ if (@draw) {
+ my $width = scalar @{ $table->[0] };
+ my @imgpal = map {
+ [ ref $_ ? @{$_}[1 .. 3] : map {hex} /(..)(..)(..)/ ]
+ } map { @{$_} } @{$table};
+ for (@draw) {
+ print "<tr><td colspan=$width>", img_egapal(\@imgpal, @{$_});
+ }
+ }