# Place sidewaystable together with text

My sidewaystable is always placed on a separate page! How do I make it appear exactly where it is defined? Is that possible?

• text
• sidewaystable
• page break
• text

I've done something like this:

\begin{document}

\section{My Table}
\paragraph{}

\begin{sidewaystable}[htbp]
\centering
\captionsetup{justification=centering}
\caption{My Table}
\begin{tabular}{p{2.3cm}|p{2.3cm}p{2.3cm}}
\hline
A & B & C \\
\hline
1 & 2 & 3 \\
\hline
\end{tabular}
\label{tab:mytable}
\end{sidewaystable}

\end{document}

• Please post an MWE that shows what you've been trying so far.
– Mico
Nov 18, 2014 at 19:53
• I've posted a MWE by editing my original post. Nov 18, 2014 at 20:06
• you are lacking a documentclass, and any definition of the sidewaystable environment. Float positioning mainly depends on things such as page size that can not be deduced from an incomplete fragment Nov 18, 2014 at 20:30
• You don't say but you are using rotating package. texdoc rotating shows section 2.4 on float positioning which says that it only supports float pages not floats on a text page. Nov 18, 2014 at 20:40

You can also rotate the caption:

\documentclass{article}
\usepackage{graphicx,caption,varwidth}
\begin{document}

\section{My Table}
\paragraph{}

\begin{table}[htbp]
\centering
\captionsetup{justification=centering}
\rotatebox{90}{\begin{varwidth}{\textheight}\centering

\parbox{8cm}{\caption{My Table \label{tab:mytable}}}

\begin{tabular}{p{2.3cm}|p{2.3cm}p{2.3cm}}
\hline
A & B & C \\
\hline
1 & 2 & 3 \\
\hline
\end{tabular}
\end{varwidth}}
\end{table}

\def\a{text.. text.. text.. text.. text.. text.. text.. }
\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a

\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a

\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a

\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a

\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a

\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a

\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a
\end{document}


Therotatingpackage documentation says that sidewaystable creates a page-sized float. If I understand you correctly you want the text above the table also rotated 90 degrees, right?

For this you could use the lscapepackage. Check this post: How to change certain pages into landscape/portrait mode.

I've solved my problem so far:

\begin{document}

\section{My Table}
\paragraph{}

\begin{table}[htbp]
\centering
\captionsetup{justification=centering}
\caption{My Table}
\rotatebox{90}{
\begin{tabular}{p{2.3cm}|p{2.3cm}p{2.3cm}}
\hline
A & B & C \\
\hline
OK, & I am good... & I will not float away! \\
\hline
\end{tabular}
\label{tab:mytable}
}
\end{table}

\end{document}


For me, this solution is acceptable.