Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
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
    
That did it, thanks! –  Lennart Feb 6 '13 at 15:10
add comment

1 Answer

up vote 5 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.