I need to make a table that spans several pages, likely in landscape format. The code that I have pasted below works well, but I need it to be longtable
instead of table
so that I can continue adding rows of information without going beyond the page dimensions. When I replace table
with longtable
, I get an error message:
Package array Error: Illegal pream-token (\caption): `c' used.
I should also add that I have the following in my preamble so that tables are APA formatted, and so that I can have automatically-numbered row.
\DeclareCaptionLabelSeparator*{spaced}{\\[1ex]}
\captionsetup[table]{textfont=it,format=plain,justification=justified,
singlelinecheck=false,labelsep=spaced,skip=0pt, belowskip=-10pt}
\preto\tabular{\setcounter{magicrownumbers}{0}}
\newcounter{magicrownumbers}
\newcommand\rownumber{\stepcounter{magicrownumbers}\arabic{magicrownumbers}.}
Below is my table. Any thoughts here? Thanks in advance!
\begin{landscape}
\begin{table}[h]
\caption{Table Caption Goes Here}
\label{table_lable}
\begin{tabular}{p{1cm} p{10.75cm} p{3.25cm} p{3.75cm}}
\toprule
No. & Header1 & Header2 & Header3 \\
\midrule
{\makebox[0.5cm][l]{1-\rownumber}} & (a) text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text & text text text text text text & text text text text text text \\
& (b) text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text & text text text text text text & text text text text text text \\
& (c) text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text & text text text text & text text text text \\
{\makebox[0.5cm][l]{1-\rownumber}} & (a) text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text & text text text text & text text text text \\
& (b) text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text & text text text text & text text text text \\
{\makebox[0.5cm][l]{1-\rownumber}} & text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text & text text text text & text text text text \\
\bottomrule
\end{tabular}
%\bigskip
%\small\textit{Note}.
\end{table}
\end{landscape}
tabular
withlongtable
, remove thetable
environment and place\caption and
\label` inside of thelongtable
environment. Don't forget to add a\\
after the label.