并排的三部分表?

并排的三部分表?

我遇到了一个小问题,我有两个 threeparttables,它们足够小,可以放在一个横向页面上,但我不知道如何让它们并排。在 table 环境中包含两个 threeparttable 环境只会使它们彼此上下排列(至少对我来说是这样)。

有什么建议吗?我发布了下面的表格。抱歉,它们不够简单,但我想包括我正在使用的所有内容(以防万一是我使用的其他软件包导致了问题。)

\usepackage{threeparttable}
\usepackage{dcolumn}
\usepackage{multicolumn}
\usepackage{multirow}
\usepackage{amsmath}

\begin{document}

\begin{table}[p] 
\centering

\begin{threeparttable}

\caption{Variance Decomposition: 1915--1963$^a$}

\label{VarDecomp}

\begin{tabular}{c | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{1.2} | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{2.2} }

\hline \hline
\multirow{2}{*}{Period} & \multicolumn{3}{c |}{Output Growth} & \multicolumn{3}{c}{Deficit Ratio} \\
&  \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c |}{$\varepsilon_g$} & \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c}{$\varepsilon_g$} \\ \hline

1 & 3.13 & 89.86 & 7.01 & 0.99 & 24.41 & 74.60 \\

2 & 2.04 & 88.74 & 9.22 & 1.05 & 29.32 & 69.63 \\

3 & 1.45 & 94.10 & 4.45 & 0.98 & 35.78 & 63.24 \\

4 & 1.64 & 98.15 & 0.21 & 0.98 & 39.97 & 59.06 \\

5 & 2.25 & 96.10 & 1.65 & 1.04 & 42.31 & 56.65 \\ \hline

6 & 2.92 & 89.87 & 7.21 & 1.16 & 43.50 & 55.34 \\

7 & 3.40 & 84.91 & 11.69 & 1.31 & 43.82 & 54.87 \\

8 & 3.64 & 84.18 & 12.18 & 1.46 & 43.52 & 55.02 \\

9 & 3.68 & 86.36 & 9.96 & 1.56 & 42.92 & 55.52 \\

10 & 3.60 & 89.09 & 7.30 & 1.61 & 42.31 & 56.08 \\ \hline

11 & 3.49 & 91.13 & 5.38 & 1.59 & 41.87 & 56.53 \\

12 & 3.39 & 92.28 & 4.33 & 1.55 & 41.65 & 56.80 \\

13 & 3.34 & 92.75 & 3.91 & 1.50 & 41.61 & 56.89 \\

14 & 3.34 & 92.78 & 3.88 & 1.46 & 41.67 & 56.87 \\

15 & 3.38 & 92.55 & 4.07 & 1.44 & 41.76 & 56.80 \\ \hline

16 & 3.46 & 92.22 & 4.32 & 1.42 & 41.85 & 56.73 \\

17 & 3.56 & 91.88 & 4.56 & 1.41 & 41.90 & 56.68 \\

18 & 3.68 & 91.59 & 4.73 & 1.41 & 41.93 & 56.65 \\

19 & 3.80 & 91.38 & 4.82 & 1.41 & 41.94 & 56.65 \\

20 & 3.92 & 91.23 & 4.85 & 1.41 & 41.93 & 56.66   \\ 

\hline \hline
\end{tabular}

\begin{tablenotes}
    \footnotesize
    \item[a] Results are expressed as a percent of variation.
    \item[b] The shock $\varepsilon_\tau$ represents the cumulative effects of shocks to the top marginal rate $\varepsilon_m$ and the capital gains rate $\varepsilon_c$.
\end{tablenotes}

\end{threeparttable} 

\quad

\begin{threeparttable}

\caption{Variance Decomposition: 1964--2012$^a$}

\label{VarDecomp}

\begin{tabular}{c | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{1.2} | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{2.2} }

\hline \hline
\multirow{2}{*}{Period} & \multicolumn{3}{c |}{Output Growth} & \multicolumn{3}{c}{Deficit Ratio} \\
&  \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c |}{$\varepsilon_g$} & \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c}{$\varepsilon_g$} \\ \hline

1 & 3.13 & 89.86 & 7.01 & 0.99 & 24.41 & 74.60 \\

2 & 2.04 & 88.74 & 9.22 & 1.05 & 29.32 & 69.63 \\

3 & 1.45 & 94.10 & 4.45 & 0.98 & 35.78 & 63.24 \\

4 & 1.64 & 98.15 & 0.21 & 0.98 & 39.97 & 59.06 \\

5 & 2.25 & 96.10 & 1.65 & 1.04 & 42.31 & 56.65 \\ \hline

6 & 2.92 & 89.87 & 7.21 & 1.16 & 43.50 & 55.34 \\

7 & 3.40 & 84.91 & 11.69 & 1.31 & 43.82 & 54.87 \\

8 & 3.64 & 84.18 & 12.18 & 1.46 & 43.52 & 55.02 \\

9 & 3.68 & 86.36 & 9.96 & 1.56 & 42.92 & 55.52 \\

10 & 3.60 & 89.09 & 7.30 & 1.61 & 42.31 & 56.08 \\ \hline

11 & 3.49 & 91.13 & 5.38 & 1.59 & 41.87 & 56.53 \\

12 & 3.39 & 92.28 & 4.33 & 1.55 & 41.65 & 56.80 \\

13 & 3.34 & 92.75 & 3.91 & 1.50 & 41.61 & 56.89 \\

14 & 3.34 & 92.78 & 3.88 & 1.46 & 41.67 & 56.87 \\

15 & 3.38 & 92.55 & 4.07 & 1.44 & 41.76 & 56.80 \\ \hline

16 & 3.46 & 92.22 & 4.32 & 1.42 & 41.85 & 56.73 \\

17 & 3.56 & 91.88 & 4.56 & 1.41 & 41.90 & 56.68 \\

18 & 3.68 & 91.59 & 4.73 & 1.41 & 41.93 & 56.65 \\

19 & 3.80 & 91.38 & 4.82 & 1.41 & 41.94 & 56.65 \\

20 & 3.92 & 91.23 & 4.85 & 1.41 & 41.93 & 56.66   \\ 

\hline \hline
\end{tabular}

\begin{tablenotes}
    \footnotesize
    \item[a] Results are expressed as a percent of variation.
    \item[b] The shock $\varepsilon_\tau$ represents the cumulative effects of shocks to the top marginal rate $\varepsilon_m$ and the capital gains rate $\varepsilon_c$.
\end{tablenotes}

\end{threeparttable}

\end{table}

\end{document}

答案1

不要在表格之间结束段落。只需添加一些水平空间来\quad分隔它们,然后它们就会保持在一起。这是一个简单的例子

\begin{threeparttable}
\caption{Left}
\begin{tabular}{cc}
Hello & There \\
This must be & a table \\
\end{tabular}
\end{threeparttable}
\quad
\begin{threeparttable}
\caption{Right}
\begin{tabular}{cc}
Hello & There \\
123 &  3545 \\
123 &  3545 \\
123 &  3545 \\
\end{tabular}
\end{threeparttable}

从而产生了这个

Latex 制作的表格图片

相关内容