5

I have a landscape page with one table on it. My current code horizontally centers the table, but how can I also vertically center it?

\documentclass[10pt,a4paper]{report}
\usepackage[latin1]{inputenc}
\usepackage[landscape]{geometry}
\usepackage[german]{babel}
\usepackage{lmodern}
\usepackage{adjustbox}

\begin{document}

\begin{adjustbox}{center}
 \resizebox{27cm}{!}{

  \begin{tabular}{|*7c|}
  \hline 
  \multicolumn{1}{|c|}{Column 1} &
  \multicolumn{2}{|c|}{Column 2} &
  \multicolumn{2}{|c|}{Column 3} &
  \multicolumn{2}{|c|}{Column 4} \\
  \hline
  1. Row & a & b & c & d & e & f \\ 
  \hline 
  % more lines here
  \end{tabular} 
 }

\end{adjustbox}

\end{document}

I omitted a the remaining rows here for the sake of clarity, but they don't occupy more than 50% of the page, so there is still plenty of space at the bottom. Putting the tabular in a table with \centering (as often suggested in that case) fails with Not in outer par mode. I assume that it's due to the adjustbox and resizebox.

  • 2
    \vspace*{\fill} before and after the adjustbox. You will perhaps have to add some additional \vspace to correct the difference in the margins. – Ulrike Fischer Feb 6 '13 at 15:05
6

\vspace*{\fill} before and after the adjustbox. You will perhaps have to add some additional \vspace to correct the difference in the margins.

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.