digits: reorder columns to start with zero
[sheet.git] / Shiar_Sheet / FormatChar.pm
index ee0c31065f9c7e716dafb92b38960d8af0a8b911..834b71bc03405f32198a348af6a9995f71d20738 100644 (file)
@@ -181,10 +181,12 @@ sub cell {
                }
        }
 
-       return sprintf('<td%s%s%s>%s%s',
-               defined $title  ? qq{ title="$title"}  : '',
-               @class ? sprintf(' class="%s"', join ' ', @class) : '',
-               $html || '',
+       return sprintf('<%s>%s%s',
+               join(' ', 'td',
+                       defined $title  ? qq{ title="$title"}  : (),
+                       @class ? sprintf('class="%s"', join ' ', @class) : (),
+                       $html || (),
+               ),
                $cell eq '' ? '&nbsp;' : $cell,
                $anno,
        );
@@ -225,9 +227,13 @@ sub table {
                        $colspan++;
                        next;
                }
+               elsif ($cell eq '>-') {
+                       $rows[-1] .= '<th>';
+                       next;
+               }
 
                $rows[-1] .= $self->cell($cell,
-                       $colspan > 1 && qq{ colspan="$colspan"},
+                       $colspan > 1 && qq{colspan="$colspan"},
                );
 
                $colspan = 1;