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.

This question already has an answer here:

I'm trying to get a table centered both vertically and horizontally in a landscape page. I've tried some of the solutions proposed around here but I can't get them to work in my specific case.

Here is my code:

\documentclass{article}
\usepackage{float,lscape}
\begin{document}
\begin{landscape}
\begin{table}[htb!]
    \centering
    \tiny
    \setlength{\tabcolsep}{2pt}
    \begin{tabular}{|ll|*4r|*4r|*4r|*4r|*4r|}
    % ...
    \end{tabular}
    \caption{A very wide table}
    \label{tab:wide_table}
\end{table}
\end{landscape}
\end{document}
share|improve this question

marked as duplicate by Jubobs, Thorsten, Kurt, Guido, Martin Schröder Apr 21 '13 at 19:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Please make your code a minimal working example (MWE), starting with \documentclass{...} and ending with \end{document}. –  Jubobs Apr 21 '13 at 17:20
    
This may be of interest. –  Jubobs Apr 21 '13 at 17:27
2  
By using [htb!] you have prevented the one float area that vertically centers. You could use [p] –  David Carlisle Apr 21 '13 at 17:28

1 Answer 1

up vote 2 down vote accepted

Merely to try and provide a minimal working example, I would like to propose the following, adding to the questioner's input the suggestions in the comments.

\documentclass{article}
\usepackage{float,lscape}
\begin{document}
\begin{landscape}
    \begin{table}[p]
        \centering
        \tiny
        \setlength{\tabcolsep}{2pt}
        \begin{tabular}{|ll|*4r|*4r|*4r|*4r|*4r|}
        % ...
        \end{tabular}
        \caption{A very wide table}
        \label{tab:wide_table}
    \end{table}
\end{landscape}
\end{document}

Here I assumed that package lscape is used for the landscape environment, and float for the [htb!] argument, which is changed to [p] for the vertical alignment as David Carlisle pointed out.

Maybe practical for vertically centering other things than tables and figures (that don't take the [p] argument) is this other example.

\documentclass{article}
\usepackage{float,lscape}
\begin{document}
\begin{landscape}
    \topskip0pt
    \vspace*{\fill}
    \begin{table}[htb!]
        \centering
        \tiny
        \setlength{\tabcolsep}{2pt}
        \begin{tabular}{|ll|*4r|*4r|*4r|*4r|*4r|}
        % ...
        \end{tabular}
        \caption{A very wide table}
        \label{tab:wide_table}
    \end{table}
    \vspace*{\fill}
\end{landscape}
\end{document}

The trick in this case is in the \vspace*{\fill}, as was proposed in this other thread: Vertically center text on a page.

share|improve this answer
    
Thanks! It's working now. –  wizplum Apr 21 '13 at 18:12

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