Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a big table which contains hundreds of rows. I want to repeat the top two rows on every page of the table. How can I do it in TeX?

share|improve this question
    
This is also a duplicate of this question –  Alan Munn Feb 18 '11 at 5:04
3  
@Alan: It's related, but it isn't a duplicate. More of a follow-up question. –  Caramdir Feb 18 '11 at 5:21

2 Answers 2

up vote 30 down vote accepted

Both the longtable package and the supertabular package can do this. Here's an example using longtable:

\documentclass{article}
\usepackage{longtable}
\begin{document}      
\begin{longtable}{ccc}
\hline
Column 1 & Column 2 & Column 3\\
\hline
\endhead % all the lines above this will be repeated on every page
A & B & C\\
A & B & C\\
... many lines of table ...
\end{longtable}
\end{document}
share|improve this answer
    
I'd like to mention that I tried this solution with a longtabu table and it worked. –  macmadness86 Apr 11 '13 at 10:23

A solution with continued headers and footers

\documentclass{article}
\usepackage{longtable}
\begin{document}      

\begin{longtable}{ccc}
\caption{My caption for this table\label{foo}}\\\hline
Column 1 & Column 2 & Column 3\\\hline
\endfirsthead
\multicolumn{3}{@{}l}{\ldots continued}\\\hline
Column 1 & Column 2 & Column 3\\\hline
\endhead % all the lines above this will be repeated on every page
\hline
\multicolumn{3}{r@{}}{continued \ldots}\\
\endfoot
\hline
\endlastfoot
A & B & C\\     A & B & C\\
A & B & C\\     A & B & C\\
A & B & C\\ \newpage
A & B & C\\     A & B & C\\
A & B & C\\     A & B & C\\
\end{longtable}
\end{document}

page1page2

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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