我如何对齐这两个表,以便第一行从同一行开始?目前,我有以下代码:
\begin{minipage}{0.6\linewidth}
\begin{tabular}{|c c c|}
\hline
cell1 & cell2 & cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell7 & cell8 & cell9 \\
\hline
cell10 & cell11 & cell12 \\
\hline
cell13 & cell14 & cell15 \\
\hline
cell16 & cell17 & cell18 \\
\hline
cell19 & cell20 & cell21 \\
\hline
\end{tabular}
\end{minipage}
\begin{minipage}{0.3\linewidth}
\begin{tabular}{|c c c|}
\hline
cell1 & cell2 & cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell7 & cell8 & cell9 \\
\hline
cell10 & cell11 & cell12 \\
\hline
cell13 & cell14 & cell15 \\
\hline
\end{tabular}
\end{minipage}
答案1
这个怎么样?
\documentclass{article}
\begin{document}
\begin{minipage}{0.8\linewidth}
\begin{tabular}[t]{|c c c|}
\hline
cell1 & cell2 & cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell7 & cell8 & cell9 \\
\hline
cell10 & cell11 & cell12 \\
\hline
cell13 & cell14 & cell15 \\
\hline
cell16 & cell17 & cell18 \\
\hline
cell19 & cell20 & cell21 \\
\hline
\end{tabular}
\hfill
\begin{tabular}[t]{|c c c|}
\hline
cell1 & cell2 & cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell7 & cell8 & cell9 \\
\hline
cell10 & cell11 & cell12 \\
\hline
cell13 & cell14 & cell15 \\
\hline
\end{tabular}
\end{minipage}
\end{document}
以下代码使用了两个小页面:
\documentclass[12pt]{article}
\usepackage[table,xcdraw]{xcolor}
\usepackage{tabularx}
\begin{document}
\begin{minipage}[t]{0.5\linewidth}
\begin{tabular}[t]{|c c c|}
\hline
cell1 & cell2 & cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell7 & cell8 & cell9 \\
\hline
cell10 & cell11 & cell12 \\
\hline
cell13 & cell14 & cell15 \\
\hline
cell16 & cell17 & cell18 \\
\hline
cell19 & cell20 & cell21 \\
\hline
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}[t]{0.4\linewidth}
\begin{tabular}[t]{|c c c|}
\hline
cell1 & cell2 & cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell7 & cell8 & cell9 \\
\hline
cell10 & cell11 & cell12 \\
\hline
cell13 & cell14 & cell15 \\
\hline
\end{tabular}
\end{minipage}
\end{document}