7

I am new to LaTeX, I am writing a thesis, in which I have to add a table, the width of table is larger than text width and length can be fit in vertically. In order to fit the width of table, what is good idea to add table on horizontal page OR add it vertically without limitation of text width?

In order to add horizontally how I can do it? Response will be matter a lot.

Thanks

10

For one table (or figure) in landscape orientation you can use \begin{sidewaystable} ... \end{sidewaystable} (or \begin{sidewaysfigure} ... \end{sidewaysfigure}) from package rotating. For example:

\documentclass{book}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage[labelfont=bf]{caption} % optional

\usepackage{ragged2e}
\usepackage{lipsum}% for dummy text

\begin{document}
\lipsum[1]
\textbf{Here is inserted \texttt+sidewaystable+}.
\begin{sidewaystable}
    \centering
\caption{Wide table}
    \label{tab:wide-item-tbl}
\begin{tabularx}{\textwidth}{|*{4}{>{\RaggedRight\arraybackslash}X|}}
    \hline
\lipsum[1]  &   \lipsum[2]  &   \lipsum[3]  &   \lipsum[4]  \\
    \hline
\end{tabularx}
\end{sidewaystable}
\lipsum[2-9]
\end{document}

Table will appear on the next page.

  • Thank you for your answer. It is the thing that I was expecting. one more thing, the page does not rotate, only table rotate horizontally, I also would like to rotate the Page as well? any suggestion – user7057295 Dec 24 '16 at 20:18
  • how you expect that page will rotate? in viewer? – Zarko Dec 24 '16 at 21:55
  • Yes, I mean to say in pdf viewer , we do not have to manually rotate the page, it should be in the same way as the previous page are. – user7057295 Dec 24 '16 at 22:23
  • @user7057295, about this is better to ask new question. – Zarko Dec 24 '16 at 23:14
  • 1
    @Zarko do you know if it's possible to NOT rotate the caption of a rotated table? EDIT: solved by myself by putting tabular only (and not the caption) inside sideways instead of putting table inside sidewaystable – Taekwondavide Apr 20 '18 at 17:43
7

If it is OK for you to have one page rotated as a landscape where to have only the table, try the lscape package:

\usepackage{lscape} 
...
\begin{document}

Text that will end up in portrait (normal) mode

\begin{landscape}
[insert table here that will be displayed horizontally]
\end{landscape}

Rest of the text here, again in portrait mode

See also this question: How to change certain pages into landscape/portrait mode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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