3

I have a series of tables (of varying lengths) on a page(s) and then a spot for a signature (which needs to be on the bottom of the page) That is working well, however sometimes the signature ends up being the only item on the page which just looks odd. In this case I would like the last table to also be pushed on to the next page but up the top. Which I have no idea how to do

    \begin{tabularx}{\textwidth}{Xr}
    \arrayrulecolor{tableHeadings}
    \multicolumn{2}{l}{\cellcolor{tableHeadings} \textcolor{white}{Academic Subjects}}  \\
    \hline
        Mathematical Methods&2016\\
        Chinese Second Language&2015\\
        Chemistry&2016\\
        Specialist Mathematics&2016\\
        English as an Additional Language&2016\\
        German&2016\\
  \hline
  \end{tabularx}
  \vspace{1cm}

       \begin{tabularx}{\textwidth}{Xr}
     \arrayrulecolor{tableHeadings}
      \multicolumn{2}{l}{\cellcolor{tableHeadings} \textcolor{white}{House Participation}}  \\
     \hline
        Mathematical Methods&2016\\
        Chinese Second Language&2015\\
        Chemistry&2016\\
        Specialist Mathematics&2016\\
        English as an Additional Language&2016\\
        German&2016\\
  \hline
  \end{tabularx}
  \vspace{1cm}
       \begin{tabularx}{\textwidth}{Xr}
     \arrayrulecolor{tableHeadings}
      \multicolumn{2}{l}{\cellcolor{tableHeadings} \textcolor{white}{APS / AGSV Sport Participation}}  \\
     \hline
     Table Tennis&2014, 2015, 2016\\
Soccer&2014, 2015, 2016\\
  \hline
  \end{tabularx}
  \vspace{1cm}

%----------------------------------------------------------------------------------------
%   Signature
%----------------------------------------------------------------------------------------
\par\vspace*{\fill}
  {
      \begin{tabular}{ccc}
      \line(1,0){200}& \hspace{3cm}& \line(1,0){200} \\
        Person A & & Person B \\
       \small \textit{Qualifications}  && \small  \textit{BSc} \\
        Title && Position
      \end{tabular}
  }
{\clearpage}

\newpage
  • If you replace \vspace* with \vspace then at least it will show up at the top of the last page. – John Kormylo Oct 10 '16 at 22:55
3

Untested as you have provided no complete example but...

\end{tabularx}
  \vspace{1cm}
       \begin{tabularx}

adds the vertical space in horizontal mode so after the second table.

You almost always want a blank line before \vspace so it is added in vertical mode

\end{tabularx}

  \vspace{1cm}
       \begin{tabularx}

then to prevent a pagebreak before the signature:

 \end{tabularx}

  \nopagebreak
  %\vspace{1cm}

%----------------------------------------------------------------------------------------
%   Signature
%----------------------------------------------------------------------------------------
\vspace{\fill}
  {%%%%
      \begin{tabular}{ccc}

MWE with help of John

\documentclass{article}
\usepackage{tabularx}
\usepackage{color}
\usepackage{colortbl}

\definecolor{tableHeadings}{gray}{0.6}% previously undefined

\begin{document}
\rule{1pt}{20\baselineskip}

\begin{tabularx}{\textwidth}{Xr}
    \arrayrulecolor{tableHeadings}
    \multicolumn{2}{l}{\cellcolor{tableHeadings} \textcolor{white}{Academic Subjects}}  \\
    \hline
        Mathematical Methods&2016\\
        Chinese Second Language&2015\\
        Chemistry&2016\\
        Specialist Mathematics&2016\\
        English as an Additional Language&2016\\
        German&2016\\
  \hline
  \end{tabularx}

\vspace{1cm}

       \begin{tabularx}{\textwidth}{Xr}
     \arrayrulecolor{tableHeadings}
      \multicolumn{2}{l}{\cellcolor{tableHeadings} \textcolor{white}{House Participation}}  \\
     \hline
        Mathematical Methods&2016\\
        Chinese Second Language&2015\\
        Chemistry&2016\\
        Specialist Mathematics&2016\\
        English as an Additional Language&2016\\
        German&2016\\
  \hline
  \end{tabularx}

  \vspace{1cm}
       \begin{tabularx}{\textwidth}{Xr}
     \arrayrulecolor{tableHeadings}
      \multicolumn{2}{l}{\cellcolor{tableHeadings} \textcolor{white}{APS / AGSV Sport Participation}}  \\
     \hline
     Table Tennis&2014, 2015, 2016\\
Soccer&2014, 2015, 2016\\
  \hline
  \end{tabularx}

\nopagebreak
%----------------------------------------------------------------------------------------
%   Signature
%----------------------------------------------------------------------------------------
\vspace{\fill}
  {\noindent
      \begin{tabular}{ccc}
      \line(1,0){200}& \hspace{3cm}& \line(1,0){200} \\
        Person A & & Person B \\
       \small \textit{Qualifications}  && \small  \textit{BSc} \\
        Title && Position
      \end{tabular}
  }%
{\clearpage}
\end{document}
  • Thanks, so simple but yet hours of googling didn't help. I owe you! – jamesmstone Oct 10 '16 at 23:11
  • @JohnKormylo you get a break at the \nopagebreak ? oh make that \vspace rather than \vspace* (also you probably need raggedbottom to allow the previous page to run short) – David Carlisle Oct 10 '16 at 23:39

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.