0

I have a very long table that spans multiple pages. On top of the table, there is a caption like 'Table 1: A list'. Now, for the parts of the table that spans to the next pages, I want to put something like 'Table 1 (continued)' on each every page right above the table. How can I do that?

Thank you for any advice. Regards, Tung

\begin{longtable}{|p{7cm}|p{2cm}|p{2.5cm}|p{2.5cm}|}
\caption{A list\label{tab:list}} \\ 
\hline
Name       &    Company     &  Catalog Number   &   Comments    \\ \hline
a          &    b           &   123             &               \\ \hline
c          &    d           &   522             &     xyz       \\ \hline
\end{longtable}
  • Welcome at TeX.SX! You may like to open the reference manual of the longtable package, there is an example. ctan.org/pkg/longtable Those suitable commands are \endhead, \endfirsthead, \endfoot and \endlastfoot, page 4. – Malipivo Mar 30 '15 at 20:11
  • Please post small, compilable examples rather than code fragments - it is much more helpful to be able to copy-paste-compile to see what the problem is! – cfr Mar 30 '15 at 20:15
1

You can use \caption*. I'd also recommend using booktabs and dispensing with the vertical rules.

The weird page layout is just because you didn't provide an example I could use to reproduce the problem so I had to make a 3 line tabular span 2 pages...

\documentclass[a5paper,landscape,12pt]{article}
\usepackage{longtable,booktabs}
\usepackage[hscale=.9,vscale=.2]{geometry}
\begin{document}

\begin{longtable}{p{7cm}p{2cm}p{2.5cm}p{2.5cm}}
\caption{A list\label{tab:list}} \\
\toprule
Name       &    Company     &  Catalog Number   &   Comments    \\ \midrule\endfirsthead
\caption*{\tablename{} \ref{tab:list} (continued)}\\
\toprule
Name       &    Company     &  Catalog Number   &   Comments    \\ \midrule\endhead
\bottomrule\endfoot
a          &    b           &   123             &               \\
c          &    d           &   522             &     xyz       \\
\end{longtable}

\end{document}

squished tabular

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.