1

I need to place a table in the centre of a page, here is the code for the table which just centres the table horizontally, but not vertically.

\documentclass[12pt,a4paper,titlepage]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\begin{titlepage}

\begin{center}

%Title
{\Large MA2MIP Assignment 2\par}

%Individual contribution table
\begin{tabular}{|c | c|}
        \hline
        Student Number & Individual Contribution \\ \hline \hline
        23008055 & \% \\ \hline
        XXXXXXXX & \% \\ \hline         
        XXXXXXXX & \% \\ \hline
        XXXXXXXX & \% \\ \hline
        XXXXXXXX & \% \\ \hline
        XXXXXXXX & \% \\ \hline
\end{tabular}

\end{center}

\end{titlepage}


\end{document}

Some help would be great.

3
  • 1
    Welcome! Use \begin{table}[p]\centering instead of the center environment.
    – LaRiFaRi
    Commented Feb 23, 2016 at 12:23
  • Welcome! Good to see the code. Could you complete it with a minimal preamble and \end{document} so people can copy-paste-compile it to see the problem? Also, TeX doesn't spell properly so it won't recognise \begin{centre}.
    – cfr
    Commented Feb 23, 2016 at 12:23
  • @cfr I have edited the post Commented Feb 23, 2016 at 13:16

1 Answer 1

1

You can try:

\documentclass[a4paper,12pt]{article}
\usepackage{booktabs}
\begin{document}
\vspace*{\fill}
\centering
\begin{tabular}{c c}
\toprule
        Student Number & Individual Contribution \\ 
\midrule
        XXXXXXXX & \% \\ 
        XXXXXXXX & \% \\ 
        XXXXXXXX & \% \\ 
        XXXXXXXX & \% \\ 
        XXXXXXXX & \% \\ 
        XXXXXXXX & \% \\ 
\bottomrule
\end{tabular}
\vspace*{\fill}
\end{document} 

to obtain something more stylish.

You must log in to answer this question.

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