Vinod
Vinod

Reputation: 4352

How to repeat top rows of a table in each page in LaTeX

I have a table in LaTeX which spans multiple pages. I want the top two rows repeated in each page. How can I do that?

Upvotes: 0

Views: 4980

Answers (2)

Ivan Machado
Ivan Machado

Reputation: 169

you've got to use the longtable package. Here is an example of the head (source: http://users.sdsc.edu/~ssmallen/latex/longtable.html)

\begin{center}
\begin{longtable}{|l|l|l|}
\caption[Feasible triples for a highly variable Grid]{Feasible triples for highly variable Grid, MLMMH.} \label{grid_mlmmh} \\

\hline \multicolumn{1}{|c|}{\textbf{Time (s)}} & \multicolumn{1}{c|}{\textbf{Triple chosen}} & \multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline 
\endfirsthead

\multicolumn{3}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{|c|}{\textbf{Time (s)}} &
\multicolumn{1}{c|}{\textbf{Triple chosen}} &
\multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline 
\endhead

\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\endfoot

\hline \hline

%here your table content goes

\end{longtable}
\end{center}

\endlastfoot

Upvotes: 0

aioobe
aioobe

Reputation: 421040

From here:

Tables longer than a single page

[...]

Both longtable and supertabular allow definition of head- and footlines for the table; longtable allows distinction of the first and last head and foot.

[...]

Upvotes: 2

Related Questions