1

I obtained this code from a previous answer. However, when the number of rows in the two tables are different, the tables become misaligned. How can I align them at the top? I attempted using the command \begin{tabular}[t], but it did not work.

enter image description here

\documentclass[11pt]{article}
\usepackage{booktabs}
\begin{document}

\begin{table} \caption{Your Caption}

\begin{minipage}{0.5\textwidth} \begin{tabular}[t]{ccc} \toprule \textbf{Cell} & \textbf{Simulation} & \textbf{Theoretical} \ \midrule 0 & 0.0 & 7.88e-31 \ 0 & 0.0 & 7.88e-31 \ \vdots & \vdots & \vdots \ \bottomrule \end{tabular}

\end{minipage} \hfill \begin{minipage}{0.5\textwidth} \begin{tabular}[t]{ccc} \toprule \textbf{Cell} & \textbf{Simulation} & \textbf{Theoretical} \ \midrule \vdots & \vdots & \vdots \ 99 & 0.0 & 7.88-29 \ \bottomrule \end{tabular}

\end{minipage} \end{table} \end{document}

emnha
  • 445
  • 3
  • 11

1 Answers1

1

Two possibilities:

  1. Either remove the minipages so that the [t] option of the tabulars can do their job

    \documentclass[11pt]{article}
    \usepackage{booktabs}
    \begin{document}
    

    \begin{table} \caption{Your Caption}

    %\begin{minipage}{0.5\textwidth} \begin{tabular}[t]{ccc} \toprule \textbf{Cell} & \textbf{Simulation} & \textbf{Theoretical} \ \midrule 0 & 0.0 & 7.88e-31 \ 0 & 0.0 & 7.88e-31 \ \vdots & \vdots & \vdots \ \bottomrule \end{tabular} % %\end{minipage} \hfill %\begin{minipage}{0.5\textwidth} \begin{tabular}[t]{ccc} \toprule \textbf{Cell} & \textbf{Simulation} & \textbf{Theoretical} \ \midrule \vdots & \vdots & \vdots \ 99 & 0.0 & 7.88-29 \ \bottomrule \end{tabular}

    %\end{minipage} \end{table} \end{document}

  2. Align the minipages at the top:

    \documentclass[11pt]{article}
    \usepackage{booktabs}
    \begin{document}
    

    \begin{table} \caption{Your Caption}

    \begin{minipage}[t]{0.5\textwidth} \begin{tabular}[t]{ccc} \toprule \textbf{Cell} & \textbf{Simulation} & \textbf{Theoretical} \ \midrule 0 & 0.0 & 7.88e-31 \ 0 & 0.0 & 7.88e-31 \ \vdots & \vdots & \vdots \ \bottomrule \end{tabular}

    \end{minipage} \hfill \begin{minipage}[t]{0.5\textwidth} \begin{tabular}[t]{ccc} \toprule \textbf{Cell} & \textbf{Simulation} & \textbf{Theoretical} \ \midrule \vdots & \vdots & \vdots \ 99 & 0.0 & 7.88-29 \ \bottomrule \end{tabular}

    \end{minipage} \end{table} \end{document}