I have a table with large number of columns and few rows. I need to insert this table vertically in one single page. How to do. I need to do the same with a figure also, wherein I need to insert a figure in a single page
1 Answer
You can use the package rotating
, which provides the environment sidewaystable
. Your code should look as follows. Notice that the table takes one whole page (page 2). There is analogous environment sidewaysfigure
.
\documentclass{article}
\usepackage{rotating} % <-- HERE
\begin{document}
blabla dummy text
\begin{sidewaystable} % <-- HERE
\centering
\begin{tabular}{cccccccc}\hline
dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text \\\hline
dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text \\
dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text \\
dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text \\
dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text \\
dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text & dummy text \\\hline
\end{tabular}
\caption{Some caption to the table.}
\end{sidewaystable} % <-- HERE
\end{document}
-
Thanks for the tip. I tried using sideways figure I get the following error ! LaTeX Error: Not in outer par mode. Can you help me on this ?– psteelkFeb 27, 2012 at 16:45
-
That means you have used a figure or table environment inside a minipage or parbox. Presumably you don't get that error if you run the code in the answer posted? Feb 27, 2012 at 16:48
-
I have not used the figure inside a minibox or parbox ! I did not get the error if I run the code posted.– psteelkFeb 27, 2012 at 16:52
-
LaTeX thinks you did:-), can you post a small example that shows the error (just edit it in to your question) Feb 27, 2012 at 16:57
-
I got the mistake. I used the figure package within the sideways figure which was creating the problem. Thanks for you help !– psteelkFeb 27, 2012 at 16:58