[Tex/LaTex] Rotating a page containing a sideways table into landscape mode

landscaperotatingsidewaystabletables

I have a table that is pretty long horizontally, hence I am displaying it sideways. The only problem is that when I generate the pdf, I would have to rotate my head in order to read the table. Can anyone help me display my table sideways and have the page also be viewed in such a way? This is what I currently have.

  \begin{sidewaystable}
  \centering
  \begin{tabular}{|p{4.5cm}|p{1.5cm}|p{4.5cm}|p{4.5cm}|p{4.5cm}|}
(I have my table contents here)
\end{tabular}
\end{sidewaystable}

Best Answer

First: Welcome to TeX.SX!

Just make sure you include the Minimum Working Example...so others can reproduce your problem and figureout how to solve. But I got you mean, it's a common problem with long tables.

Simply load the package pdflscape and use the landscape environment, that will do the trick and auto rotate the page. this does bug out on some tablets depending on the pdf reader thats been used (i've heard it works well with adobe and MS).

For more info check Herbert answer here.

\documentclass{article}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\begin{table}
  \centering
  \begin{tabular}{|p{4.5cm}|p{1.5cm}|p{4.5cm}|p{4.5cm}|p{4.5cm}|}
(I have my table contents here)
\end{tabular}\caption{A simple table}
\end{table}
\end{landscape}
\end{document}
Related Question