1

Say I have a large table larger than the page, how can I make it so that the second page displays the headers from the previous page and also doesn't split a row in half. Something similar to CSS like:

thead { display: table-header-group }
tfoot { display: table-row-group }
tr { page-break-inside: avoid }
  • 4
    try to look at the 'longtable' package and questions here – Anthony Martin Oct 16 '16 at 21:36
  • 2
    A row cannot be split across pages. – Bernard Oct 16 '16 at 22:11
  • as noted in the answer, longtable does this, actually been doing it since before css was invented:-) – David Carlisle Oct 17 '16 at 6:45
  • @DavidCarlisle, I absolutely love it. – Forwarding Oct 17 '16 at 7:08
  • Now how can you specify the width of a column using longtable? – Forwarding Oct 17 '16 at 7:10
2

Schematic:

\documentclass{article}
\usepackage{longtable,booktabs}
\begin{document}
\begin{longtable}{ll}
  % include if you want a different header on the first page
  \toprule
  Header 1 & First page only\\
  \midrule
  \endfirsthead
  % include if you want a header on all or all-but-the-first pages
  \toprule
  Header 2 & All later pages\\
  \midrule
  \endhead
  % include for a footer on all pages
  \bottomrule
  \endfoot
  some & stuff\\
  and & lots\\
  of & it\\
  ...
  finally & this\\
\end{longtable}
\end{document}

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.