Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a table and I want to rotate it. The table has 3 rows and 4 columns, and I want to rotate the text inside this table as well. How can I do this?

share|improve this question
6  
please, for the love of god, don't use sidewaystables unless you intend the document to be read while lying down. There's nothing more annoying than having to crane your neck to read a table in a pdf, use lscape or pdflscape so the table is rotated properly when shown on a monitor. –  Shep Sep 10 '14 at 1:45

5 Answers 5

up vote 48 down vote accepted

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}
share|improve this answer

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}
share|improve this answer
1  
the landscape option is the best option: there's nothing more obnoxious than inserting a sideways table and forcing your reader to crane his neck just to read the pdf. –  Shep Sep 10 '14 at 1:42

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{graphicx}

\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}
share|improve this answer

The ctable packages also has an option to rotate the table: sideways. For example:

\documentclass{article}
\usepackage{ctable}

\begin{document}
\ctable[
caption={Your table caption},
label={tab:mytable},
botcap, % caption below table
sideways % This rotates the table
]
{ccc}
{
% Table footnotes here, see ctable docs
}
{
Column 1 & Column 2 & Column 3 \\
Row 2, 1 & 2, 2     & 2, 3 \\
}
\end{document}
share|improve this answer
    
tHANK YOU VERY MUCH GUYS . –  Negin Aug 15 '11 at 2:17

Assuming you want to rotate the table because it doesn't fit the width of a portrait page. Based on @Shep's comment to this question: use the pdflscape package (CTAN, dtx, pdf) by Heiko Oberdiek.

Package pdflscape adds PDF support to the environment landscape of package lscape by setting the PDF page attribute /Rotate

I use Lyx, and it's in the FAQ: How can I typeset certain pages of my documents in landscape mode?

Use the package lscape (or better pdflscape, which also supports pdflatex output). Add to the preamble: \usepackage{pdflscape} In the document, embrace the pages which should be in landscape mode by:

\begin{landscape}
...
\end{landscape}

All other text will be in portrait mode pages. If you don't have the pdflscape package installed, get it from ctan The lscape package is part of the graphics bundle and should be installed by default.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.