0

I can use either {sidewaystable} or {landscape} to produce a table and its caption that are landscape on a page. However, it is centered on the page. How do you move it so that it aligns with the left margin of the page?

\begin{landscape}
\begin{table}[]
\caption{Insert table caption here}
\resizebox{\textwidth}{!}{%
\begin{tabular}{llllllllllllll} 
**removed table data for posting**
\end{tabular}%
 }
\end{table}
\end{landscape}       

Gives

enter image description here

Which is centered on the page. I would like the caption and the table to be aligned to the left margin of my document.

If I use {sidewaystable} instead and add the first line of code:

\setlength\rotFPtop{152pt}
\begin{sidewaystable}
\begin{table}[]
\caption{Insert table caption here}
\resizebox{\textwidth}{!}{%
\begin{tabular}{llllllllllllll} 
**removed table data for posting**
\end{tabular}%
 }
\end{sidewaystable}

Then it will shift everything to the left as desired. But I guessed 152pt. Is there a way to determine the exact pts of the page margin?

1
  • Since there is no text on the page, it defaults to [p]. Feb 21, 2019 at 23:23

2 Answers 2

0

There is an automatic \clearpage at the beginning and end of landscape, so using a float (table) is fine. If you want to position the contents, you can use a minipage INSIDE the float to fit the entire text area.

For some reason, showframe is acting up for me.

\documentclass{article}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
  \begin{table}[p]
    \begin{minipage}[t][\textheight][t]{\linewidth}% use entire text area
      \caption{Insert table caption here}
      \resizebox{\textwidth}{!}{%
        \begin{tabular}{lllll lllll llll}
          \multicolumn{14}{c}{**removed table data for posting**}
        \end{tabular}%
      }%
    \end{minipage}
  \end{table}
\end{landscape}
\end{document}

full page

0
1
  • your code snippet is not complete :-(
  • see if the following solution givers what you looking for

edit: for test purposes i add package showframe that you can see, that the table is at top left side of page in landscape orientation.

    \documentclass{article}
    \usepackage{lscape}
    \usepackage{tabularx}
    \usepackage{caption}

    %---------------- show page layout. don't use in a real document!
    \usepackage{showframe}
    \renewcommand\ShowFrameLinethickness{0.15pt}
    \renewcommand*\ShowFrameColor{\color{red}}
    %---------------------------------------------------------------%
    \begin{document}
    \begin{landscape}        
    \vspace*{-1.5\baselineskip}
    \captionsetup{singlelinecheck=false}
    \captionof{table}{Insert table caption here.}
    \label{my-label}
    \begin{tabularx}{\linewidth}{|*{12}{X|}}
    \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12    \\
    \hline
    \end{tabularx}
    \end{landscape}
    \end{document}

enter image description here

4
  • please, show us what you try so far. it is still not clear what you like too have. edit your question and add this there. page i show is shown rotated, that you can easily see its content.
    – Zarko
    Feb 21, 2019 at 19:54
  • If I use {sidewaystable} instead of {landscape} and keep the rest of the code the same, I can shift it towards the left margin by adding this as the first line of code %\setlength\rotFPtop{152pt} . Is there a way to determine how many pts my margin is? 152 pt was just a guess...
    – mef022
    Feb 21, 2019 at 20:15
  • Sorry - that does not work. It is not at the left margin of the page.
    – mef022
    Feb 21, 2019 at 20:24
  • i edit my answer. added is package for drawing text borders. now should be clearly seen, that the table is in the place as you ask in your question.
    – Zarko
    Feb 21, 2019 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .