General ⇒ Rotating tables
Rotating tables
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?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: Rotating tables
Rotating tables
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}
Code: Select all
\begin{landscape}\centering\begin{table}[htb]\end{table}\end{landscape}
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.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rotating tables
Code: Select all
%TEXMF%\doc\latex\rotating
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Rotating tables
\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.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rotating tables
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 1
- Joined: Wed Oct 22, 2008 10:31 pm
Re: Rotating tables
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?
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Rotating tables
you could use the lscape package or pdflscape in the case of pdflatex, put the longtable into a landscape environment.
Stefan
Rotating tables
Code: Select all
\begin{landscape}\begin{table}[!ht]\begin{center}\begin{tabular}{}\end{tabular}\end{center}\caption{}\label{}\end{table}\end{landscape}