# Centering table in landscape page [duplicate]

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}

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

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

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.

-
Thanks! It's working now. –  wizplum Apr 21 '13 at 18:12