如何将一个表格水平附加到另一个表格?

如何将一个表格水平附加到另一个表格?

如何将一个表格水平附加到另一个表格?

\begin{tabular}{|c|c|c|}
\hline 
some thing & some thing & some thing \\
\hline 
some thing & some thing & some thing \\
\hline 
some thing & some thing & some thing \\
\hline 
\end{tabular}




\begin{tabular}{|c|c|c|c|c|c|}
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline 
    \end{tabular}

在此处输入图片描述 必须将上述两个表组合起来,使得第一个表和第二个表水平连接。

那是,

在此处输入图片描述

MWE(我尝试过)。

\documentclass{article}

\begin{document}
\begin{tabular}{ll}
\begin{tabular}{|c|c|c|}
\hline 
some thing & some thing & some thing \\
\hline 
some thing & some thing & some thing \\
\hline 
some thing & some thing & some thing \\
\hline 
\end{tabular} & 
\begin{tabular}{|c|c|c|c|c|c|}
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline 
    \end{tabular}
\end{tabular}

\end{document}

答案1

tabular其定位与字母完全相同。

XY

设置为相邻

X
Y

并排设置,中间留有一个单词的空格

X

Y

设置为上下两个段落。

您可能还希望\begin{tabular}[t]在两种情况下使用,以便它们在顶行对齐,而不是垂直中心对齐。

所以....

在此处输入图片描述

\documentclass{article}

\begin{document}

\begin{tabular}[t]{|c|c|c}
\hline 
some thing & some thing & some thing \\
\hline 
some thing & some thing & some thing \\
\hline 
some thing & some thing & some thing \\
\hline 
\end{tabular}\begin{tabular}[t]{|c|c|c|c|c|c|}
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline     One &One &One &One  \\
\hline 
\end{tabular}

\end{document}

相关内容