$table->{dataKeys} = [ 'name', 'addr', 'bits', 'description' ];
$table->{format} = '@{} l l l p{8cm} @{}';
+$table->{caption} = 'registers, maan';
my $tablefile = FileHandle->new("./table.tex", 'w');
print $tablefile $table->generateString();
my $self = shift;
my $str = "";
- $str.='\begin{table}[tbp]
- \centering';
+# $str.='\begin{table}[tbp]
+# \centering';
+# $str .= '\begin{center}';
- $str .= '\begin{tabular}'."\n";
+ $str .= '\begin{longtable}'."\n";
$str .="{".($self->{format}||"")."}\n";
+
+# $str.='\caption{'.$self->{caption}.'}' if defined $self->{caption}."\n";
+ $str .= '\\\\';
$str.='\toprule'."\n";
+# $str.='\hline'."\n";
if ( @{$self->{header}} ){ # if no header list ...
$str.= " ".join(" & ",@{$self->{header}}).' \\\\'."\n";
} else { # print the keys instead
$str.= " ".join(" & ",@{$self->{dataKeys}}).' \\\\'."\n";
}
$str.='\midrule'."\n";
+ $str.='\hline'."\n";
+ $str.='\endfirsthead';
+
+
+ $str.='\hline \multicolumn{'.scalar(@{$self->{dataKeys}}).'}{r}{\textit{Continued on next page}} \\\\
+ \endfoot
+ \hline
+ \endlastfoot';
for my $data (@{$self->{data}}){
my @line;
$str.=$line;
}
$str.='\bottomrule'."\n";
- $str.='\end{tabular}'."\n";
+# $str.='\hline'."\n";
+
+ $str .='\caption{aoeiaeoi}'."\n";
+ $str .='\label{tab:long}'."\n";
+
+ $str.='\end{longtable}'."\n";
- $str.='\caption{'.$self->{caption}.'}' if defined $self->{caption}."\n";
- $str.='\label{'.$self->{label}.'}' if defined $self->{label}."\n";
- $str.='\end{table}'."\n";
+# $str.='\label{'.$self->{label}.'}' if defined $self->{label}."\n";
+# $str.='\end{table}'."\n";
+# $str .= '\end{center}';
return $str;
}
\ No newline at end of file