How to rotate a table?
Another option is to use sidewaystable
from the rotating
package.
\documentclass{article}
\usepackage{rotating}
\begin{document}
\begin{sidewaystable}
\centering
\caption{Your caption here}
\begin{tabular}{ll}
First First & First Second\\
Second First & Second Second
\end{tabular}
\end{sidewaystable}
\end{document}
If all you want to do is rotate the complete table, but keep everything else on the page unrotated, you can use the \rotatebox{<angle>}{ ... }
command from the graphicx
package:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\rotatebox{90}{
\begin{tabular}{ll}
First First & First Second\\
Second First & Second Second
\end{tabular}
}
\end{document}
However, if you have a large table that will take up the whole page, you might want to rotate the page instead of the table. You can do this using the pdflscape
package if you're compiling with pdflatex
, or lscape
if you're using latex
, which introduce a landscape
environment.
\documentclass{article}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\begin{tabular}{ll}
First First & First Second\\
Second First & Second Second
\end{tabular}
\end{landscape}
\end{document}
As Jake said you can use \rotatebox
from the graphicx
package to rotate a table. This is perfectly fine for uncomplicated tables. However, this will read the whole table as macro argument which doesn't allow for verbatim or other special content and isn't that efficient.
As alternative you can use the \adjustbox
macro or adjustbox
environment from the adjustbox
package (written by me). Both process the content as real box and not as macro argument as therefore avoids the mentioned drawbacks:
\documentclass{article}
\usepackage{adjustbox}
\begin{document}
\begin{adjustbox}{angle=90}
\begin{tabular}{ll}
First First & First Second\\
Second First & Second Second
\end{tabular}
\end{adjustbox}
\end{document}
Alternatively, you can use the very new package realboxes
.
When loaded with the graphicx
option (or without any but after graphicx
) it provides \Rotatebox
which works like \rotatebox
but reads the content also as real box:
\documentclass{article}
\usepackage[graphicx]{realboxes}
\begin{document}
\Rotatebox{90}{%
\begin{tabular}{ll}
First First & First Second\\
Second First & Second Second
\end{tabular}
}%
\end{document}