use strict;
use warnings;
use HTML::ElementTable;
my @back_row = qw(rook knight marshal bishop cardinal
queen king
cardinal bishop marshal knight rook);
my @middle_row = qw(pawn squire squire novice priest
princess prince
priest novice squire squire pawn);
my @front_row = (undef, ('pawn') x 10, undef);
my $t = HTML::ElementTable->new(maxrow => 11, maxcol => 11);
for my $c (0 .. $#back_row) {
$t->cell($_, $c)->push_content($back_row[$c]) for (0, 11);
}
for my $c (0 .. $#middle_row) {
$t->cell($_, $c)->push_content($middle_row[$c]) for (1, 10);
}
for my $c (0 .. $#front_row) {
next unless $front_row[$c];
$t->cell($_, $c)->push_content($front_row[$c]) for (2, 9);
}
for my $r (0 .. $t->maxrow) {
for my $c (0 .. $t->maxcol) {
$t->cell($r, $c)->attr(class => $r % 2 ^ $c % 2 ? 'odd' : 'even');
}
}
print $t->as_HTML;