我从上一个答案。但是,当两个表格的行数不同时,表格就会错位。我怎样才能将它们对齐到顶部?我尝试使用命令\begin{tabular}[t]
,但没有成功。
\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}
答案1
两种可能性:
要么删除小页面,以便
[t]
表格选项可以完成其工作\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}
将小页面顶部对齐:
\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}