Graphics, Figures & Tablessidewaystable

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jjramsden
Posts: 2
Joined: Mon Aug 15, 2022 4:03 pm

sidewaystable

Post by jjramsden »

Following code produces a normally oriented table displaced towards the bottom right-hand corner of the page, instead of rotating it sideways as should happen (whether centred or not):

\documentclass[12pt]{book}
\usepackage{rotating}
\begin{document}
\begin{sidewaystable}
\caption{Websites. \label{web} }
\begin{center}
\begin{tabular}{|l|r|}
\hline
Exec & Nonexec \\
\hline
Exec R2 & Nonexec R2 \\
\hline
\end{tabular}
\end{center}
\end{sidewaystable}
\end{document}

No obvious flaw...is some unwritten extra command required?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

sidewaystable

Post by MjK »

jjramsden wrote:Following code produces a normally oriented table displaced towards the bottom right-hand corner of the page, instead of rotating it sideways as should happen
No, it doesn't and you would have seen this yourself, if you would have tagged your code as CODE:

Code: Select all

\documentclass[12pt]{book}
\usepackage{rotating}
\begin{document} 
\begin{sidewaystable}
\caption{Websites. \label{web} }
\begin{center}
\begin{tabular}{|l|r|}
\hline
Exec & Nonexec \\
\hline
Exec R2 & Nonexec R2 \\
\hline
\end{tabular}
\end{center}
\end{sidewaystable}
\end{document}
and tried out using the "Run LaTeX here" button. Sorry, but without a Infominimal working example that shows your problem, it would be hard or almost impossible to help.

BTW: You should not use center environment inside a float. Use command \centering instead:

Code: Select all

\documentclass[12pt]{book}
\usepackage{caption}% Because of table headings instead of signatures.
\usepackage{rotating}
\begin{document}
\begin{sidewaystable}
  \centering
  \caption{Websites. \label{web} }
  \begin{tabular}{|l|r|}
    \hline
    Exec & Nonexec \\
    \hline
    Exec R2 & Nonexec R2 \\
    \hline
  \end{tabular}
\end{sidewaystable}
\end{document}
The tivlist environments [lattex]center[/latex], flushleft and flushright add extra vertical space, which is not needed nor wanted here.

Note: Tables or rotating are not subjects of mine. So don't expect any further support of mine on this topic.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
Post Reply