2

I would like to align this table with a second one (horizontally), however using minipage will lead to them being displayed below each other. What did I set wrong?

\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 Answers1

2

Depending on the expected output and captions, here are three possibilities:

enter image description here

\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}

leandriis
  • 62,593