在 Minipage 中对齐表格

在 Minipage 中对齐表格

我想将这张表与第二张表(水平)对齐,但是使用 minipage 会导致它们显示在彼此下方。我设置错了什么?

\documentclass{article}
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}
\renewcommand{\arraystretch}{1.5}
\usepackage{booktabs}
\usepackage{arydshln}% draw dash-lines in tables
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\usepackage{diagbox}% diagonal box
\usepackage{multirow}% multirow for diagonal box

\begin{document}
\begin{table}
\centering
\caption{Territoriale Kategorien}
\begin{minipage}{0.5\linewidth}
\begin{tabular}{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
Deutschland                                \\
England                                    \\
Europa                                     \\
Frankreich                                 \\
Mandschurei                                \\
\bottomrule
\end{tabular}\label{ta:territory}
\\Quelle: XYZ\\
\end{minipage}
\begin{minipage}{0.5\linewidth}
\begin{tabular}{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
Deutschland                                \\
England                                    \\
Europa                                     \\
Frankreich                                 \\
Mandschurei                                \\
\bottomrule
\end{tabular}\label{ta:territory2}
\\Quelle: XYZ\\
\end{minipage}
\end{table}
\end{document}

答案1

根据预期的输出和标题,有以下三种可能性:

在此处输入图片描述

\documentclass{article}
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}}
\renewcommand{\arraystretch}{1.5}
\usepackage{booktabs}
\usepackage{arydshln}% draw dash-lines in tables
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\usepackage{diagbox}% diagonal box
\usepackage{multirow}% multirow for diagonal box


\usepackage{subcaption}
\begin{document}
\begin{table}
\begin{minipage}{0.45\linewidth}
\caption{Territoriale Kategorien - with minipages, individual caption for each table}
\label{ta:territory-minipage-first}
\centering
\begin{tabular}{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
\bottomrule
\end{tabular}\smallskip

Quelle: XYZ
\end{minipage}
\hfill
\begin{minipage}{0.45\linewidth}
\caption{Territoriale Kategorien - with minipages, individual caption for each table}
\label{ta:territory-minipages-second}
\centering
\begin{tabular}{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
\bottomrule
\end{tabular}\smallskip

Quelle: XYZ
\end{minipage}
\end{table}


\begin{table}
\caption{Territoriale Kategorien - without minipages, shared caption for both tables}
\label{ta:territory-tabular-both}
\centering
\begin{tabular}[t]{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
\bottomrule
\multicolumn{1}{l}{Quelle: XYZ}
\end{tabular}
\qquad
\begin{tabular}[t]{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
\bottomrule
\multicolumn{1}{l}{Quelle: XYZ}
\end{tabular}
\end{table}

\begin{table}
\caption{Territoriale Kategorien - with subtables, shared caption for both tables and individual subcaption for each table}\label{ta:territory-subcaption-both}
\begin{subtable}{0.45\linewidth}
\caption{subcaption}\label{ta:territory-subcaption-first}
\centering
\begin{tabular}{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
\bottomrule
\end{tabular}\smallskip

Quelle: XYZ
\end{subtable}
\hfill
\begin{subtable}{0.45\linewidth}
\caption{subcaption}\label{ta:territory-subcaption-second}
\centering
\begin{tabular}{l} 
\toprule
\multicolumn{1}{c}{\textbf{Territiorien}}  \\ 
\midrule
China                                      \\
Russland                                   \\
\bottomrule
\end{tabular}

\smallskip
Quelle: XYZ
\end{subtable}
\end{table}
\end{document}

相关内容