GeneralRotating tables

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Frank
Posts: 11
Joined: Thu Jan 25, 2007 1:40 pm

Rotating tables

Post by Frank »

I am trying to rotate my tables and their captions.

I have tried to use the package rotating, so that I can use \rotatebox{90}{}. However, this does not rotate my caption, as it has to be within the table environment.

I then tried the sidewaystable environment, but this rotates the table by 270 degrees if the pages are even and by 90 degrees for odd pages. I require the table on the even page to be rotated by 90, as two tables are on consecutive (first even then odd) pages. Then the reader would only need turn the document once to be able to read both tables simultaneously, making comparisons easier.

Any ideas?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Ledurt
Posts: 12
Joined: Tue Mar 27, 2007 7:05 pm

Re: Rotating tables

Post by Ledurt »

what about the lscape package? Use the "landscape" environment. I don't know if the caption willl rotate with the table, but I belive so.
Frank
Posts: 11
Joined: Thu Jan 25, 2007 1:40 pm

Rotating tables

Post by Frank »

Thanks Ledurt

That worked well. The only problem now is that the table is left-aligned, not centered in the page. I have tried

Code: Select all

\begin{center}
   \begin{landscape}
        \begin{table}[htb]
        \end{table}
   \end{landscape}
\end{center}
but this did not work. I then tried

Code: Select all

\begin{landscape}
    \centering
    \begin{table}[htb]
    \end{table}
\end{landscape}
with no success. I then figured that since the table would be on a page on its own anyway, the table location assignment [htb] could be changed to [p], then it would be centered in the page.

This is not an ideal set-up (even though it fulfills my formatting needs), as I may want to rotate the table and its caption by 270 degrees, instead of the 90 that lscape rotates it by. Also, if the table were not to fill an entire page, using the location assignment [p] would waste valuable space in order to center the table.

I found that using the package pdflscape conveniently turns the page on which the tables are found into landscape mode when compiling to PDF. This makes the tables easier to read in Adobe Reader.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Rotating tables

Post by localghost »

The rotating package provides two options turn and rotate, which could do the right alignment for your tables. Search for "rotating.dvi" on your system. I found it in the texmf tree.

Code: Select all

%TEXMF%\doc\latex\rotating
Then the normal usage of the sidewaystable environment will do the trick.
pfjorgeo
Posts: 6
Joined: Fri Mar 30, 2007 11:28 pm

Re: Rotating tables

Post by pfjorgeo »

Hello. When using the "rotating" package, try

\begin{sidewaystable}[!htbp]
\begin{tabular}...
...
\end{tabular}
\caption{...}
\end{sidewaystable}

That code works when compiling LaTeX => PDF (i.e., using PDFTeX directly) or LaTeX => PS => PDF (using PDFTeX through PostScript). I don't know if it works compiling LaTeX => DVI.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Rotating tables

Post by localghost »

Here is a supplement to my preceded post. As i recently read in epslatex, the rotating package accepts the options figuresright and figuresleft. That should solve the problem with the sidewaysfigure and sidewaystable environment.
nippur_1967
Posts: 1
Joined: Wed Oct 22, 2008 10:31 pm

Re: Rotating tables

Post by nippur_1967 »

help!!!
I need to use:

begin{longtable}
lot of rows and columns
end{longtable}

but i want to rotate this table due that occupies many pages, what can i do?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Rotating tables

Post by Stefan Kottwitz »

Hi,

you could use the lscape package or pdflscape in the case of pdflatex, put the longtable into a landscape environment.

Stefan
LaTeX.org admin
FeDeX
Posts: 1
Joined: Sat Nov 13, 2010 5:53 pm

Rotating tables

Post by FeDeX »

I answer to Frank. With this code the table was rotated and centered in the page:

Code: Select all

\begin{landscape}
\begin{table}[!ht]
\begin{center}
\begin{tabular}{}

\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
\end{landscape}

Post Reply