10
votes

Is there a way to have a table in LaTeX that spans multiple pages width-wise, rather than length-wise? As far as I can tell, both longtable and supertabular will break tables over multiple pages, but only by breaking between rows and I need to break between columns. Even better would be if it were possible to have a few columns repeated at on each page.

3
Recommend moving this question to tex.stackexchange.comMatthew Rankin
Find a solution on [tex.stackexchange.com][1]. [1]: tex.stackexchange.com/questions/93808/…Myles Baker
I'm voting to close this question as off-topic because there is an entire site dedicated to this: TeX - LaTeX (too old to migrate).Werner

3 Answers

1
votes

I am using this not so nice and manually configured code to split a too wide tabular:

\usepackage{tikz}

\newsavebox{\boxFinal}
\begin{lrbox}{\boxFinal}
  \scalebox{0.6}{
  \begin{tabular}{...}
...
  \end{tabular}
  }
\end{lrbox}

\begin{table}[htb]
  \centering
  \begin{tikzpicture}
    \clip (0,-\dp\boxFinal) rectangle (0.5\wd\boxFinal,\ht\boxFinal);
    \pgftext[left,base]{\usebox{\boxFinal}};
  \end{tikzpicture}
  \label{table_test1}\caption{Part 1 of 2.}
\end{table}

\begin{table}[htb]
  \centering
  \begin{tikzpicture}
    \clip (0.5\wd\boxFinal,-\dp\boxFinal) rectangle
      (\wd\boxFinal,\ht\boxFinal); \pgftext[left,base]{\usebox{\boxFinal}};
  \end{tikzpicture}
  \label{table_test2}\caption{Part 2 of 2.}
\end{table}

There is usually a need to manually correct split offsets. You can do this by adding or subtracting from 0.5\wd\boxFinal value.

The idea was taken from http://www.latex-community.org/forum/viewtopic.php?f=5&t=2867

0
votes

I've been yanking my hair out with this same problem off and on for a week. I think that this may not be entirely possible in a non-hacky sort of way.

One possible hackly solution is to use the dpfloat package: http://www.ctan.org/tex-archive/help/Catalogue/entries/dpfloat.html

Unfortunately, you'd be creating multiple tables and breaking them manually, but at least the end result should look okay. Also, this will look much better if you ditch vertical rules in your tables as per the sage guidance in the booktabs package (which you will have to google because apparently I, as a new user, don't have enough reputation to post a link to the booktabs pdf manual).

0
votes

A good solution would be to rotate the whole table 90 degrees counterclockwise, thus having more room for it.

Preamble \usepackage{pdflscape}

\newpage
\thispagestyle{empty}
\begin{landscape}
\begin{table}
...
\end{table}
\end{landscape}