1

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{}
Please print my table on this page!  

\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}
Gargamel
  • 131
  • Please post an MWE that shows what you've been trying so far. – Mico Nov 18 '14 at 19:53
  • 1
    I've posted a MWE by editing my original post. – Gargamel Nov 18 '14 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 – David Carlisle Nov 18 '14 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. – David Carlisle Nov 18 '14 at 20:40

3 Answers3

3

enter image description here

You can also rotate the caption:

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

\section{My Table}
\paragraph{}
Please print my table on this page!  

\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}
David Carlisle
  • 757,742
0

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.

0

I've solved my problem so far:

\begin{document}

\section{My Table}
\paragraph{}
Please print my table on this page!  

\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.

Gargamel
  • 131