my ($row,$col) = ('a',0); my $total_cols = $table->get_col_count(); $table->map_cell( sub { my $old = shift; $col++; my $new = qq||; $row++ and $col = 0 unless $col % $total_cols; return $new; });