I am using pgfplotstable
to import files with many rows and columns with which to create custom tables. Some tables are quite long, covering many pages. Is there a way to automatically assign the number of rows to display on a page? I could not find anything in the documentation.
My first attempts are included in the MWE which simply repeats code for each page required. There must be a better, more efficient way. Perhaps a Do While or For... syntax exists?
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage{filecontents}
\begin{document}
\begin{filecontents}{testdata.dat}
Idx Nam Dim Grd
1 Ady 53 F
2 Bar 72 C
3 Cor 83 B
4 Dar 58 D
5 Esa 68 C
6 Foo 67 C
7 Gar 74 C
8 Hur 65 D
9 Jaz 85 B
10 Ker 91 A
\end{filecontents}
{\large Table 1}
\pgfplotstabletypeset[col sep=space,
header=true,
columns={Idx,Nam,Dim,Grd}, % display specified columns
columns/Idx/.style={fixed,fixed zerofill,precision=0,column type=r},
columns/Nam/.style={column type=l,string type},
columns/Dim/.style={fixed,fixed zerofill,precision=1,column type=r},
columns/Grd/.style={column type=l,string type},
skip rows between index={5}{83}, % {43}{83}
% requires booktabs to place horiz rules
every head row/.style={before row=\toprule, after row=\midrule},
every last row/.style={after row=\bottomrule}
]{testdata.dat}
\newpage
{\large Table 1 (cont.)}
\pgfplotstabletypeset[col sep=space,
header=true,
columns={Idx,Nam,Dim,Grd}, % display specified columns
columns/Idx/.style={fixed,fixed zerofill,precision=0,column type=r},
columns/Nam/.style={column type=l,string type},
columns/Dim/.style={fixed,fixed zerofill,precision=1,column type=r},
columns/Grd/.style={column type=l,string type},
skip rows between index={0}{5}, % {0}{43}
% skip rows between index={10}{83},
every head row/.style={before row=\toprule, after row=\midrule},
every last row/.style={after row=\bottomrule}
]{testdata.dat}
\end{document}
longtable
package that allows tables on multiple pages