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.

  • 1
    Welcome! Use \begin{table}[p]\centering instead of the center environment. – LaRiFaRi Feb 23 '16 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 Feb 23 '16 at 12:23
  • @cfr I have edited the post – Will Feb 23 '16 at 13:16
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.

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.