在LaTex写作中经常会遇到双栏模板中想插入单栏的大表格,或者在单栏的模板中想插入双栏的两个独立或者不独立的小表格既省空间看起来又简洁好看。今天重点说一下后者,以备以后不时之需。原始出处见http://tex.stackexchange.com/questions/2832/how-can-i-have-two-tables-side-by-side
If you want to use subfig
because you want them to have separate captions, then that is simple as well. but remerber insert the package \usepackage{subfig}
\subfloat[caption]{\begin{tabular}{...}...\end{tabular}}
\subfloat[caption]{\begin{tabular}{...}...\end{tabular}}
If you want two tables that are independent, and thus don't want to use \subfloat
, you can use \parbox
.
\begin{table}
\parbox{.45\linewidth}{
\centering
\begin{tabular}{ccc}
\hline
a&b&c\\
\hline
\end{tabular}
\caption{Foo}
}
\hfill
\parbox{.45\linewidth}{
\centering
\begin{tabular}{ccc}
\hline
d&e&f\\
\hline
\end{tabular}
\caption{Bar}
}
\end{table}