Untertabelle über mehrere Seiten

Untertabelle über mehrere Seiten

Ich habe eine Tabelle, die aus zwei Untertabellen besteht. Ich möchte die Tabelle aufteilen können, um die Untertabellen auf verschiedenen Seiten anzuzeigen. Es scheint, dass dies nicht wie Untertabellen funktioniert und\ContinuedFloat wie es hier dargestellt wird. Mir scheint, dass \longtableauch die Umgebung für diesen Zweck nicht geeignet ist.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{subcaption}
\begin{document}

\begin{table}[!h]
\caption{General caption. \label{tab:mytable}

\begin{subtable}{1\textwidth}
\caption{Caption subtable 1}\label{cst1}
\centering
\begin{tabular}{l|l|}
Name & Description\\
\hline
a & This is a \\ 
b & This is b \\ 
\end{tabular} 
\end{subtable}

\vspace{1cm}

\begin{subtable}{1\textwidth}
\caption{Caption subtable 2}\label{cst2}
\centering
\begin{tabular}{l|l|}
Name & Description\\
\hline
c & This is c \\ 
d & This is d \\ 
\end{tabular} 
\end{subtable}

\end{table}

\end{document}

Antwort1

Genauso wiehttps://tex.stackexchange.com/a/278748/36296Sie können verwenden \ContinuedFloat, um die Untertabellen in zwei separate Floats aufzuteilen:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{subcaption}
\begin{document}

test

\begin{table}[htbp]
\caption{General caption.} \label{tab:mytable}

\begin{subtable}{1\textwidth}
\caption{Caption subtable 1}\label{cst1}
\centering
\begin{tabular}{l|l|}
Name & Description\\
\hline
a & This is a \\ 
b & This is b \\ 
\end{tabular} 
\end{subtable}
\end{table}

\pagebreak

\begin{table}[htbp]
\ContinuedFloat
\caption{General caption, continued.}% remove if the second subtible shall not have a general caption
\begin{subtable}{1\textwidth}
\caption{Caption subtable 2}\label{cst2}
\centering
\begin{tabular}{l|l|}
Name & Description\\
\hline
c & This is c \\ 
d & This is d \\ 
\end{tabular} 
\end{subtable}

\end{table}

\end{document}

Abseits des Themas, aber ich schlage vor, in Ihren Tabellen keine vertikalen Linien zu verwenden und booktabsstattdessen das Paket zu nutzen:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{subcaption}
\usepackage{booktabs}
\begin{document}

test

\begin{table}[htbp]
\caption{General caption.} \label{tab:mytable}

\begin{subtable}{1\textwidth}
\caption{Caption subtable 1}\label{cst1}
\centering
\begin{tabular}{ll}
\toprule
Name & Description\\
\midrule
a & This is a \\ 
b & This is b \\
\bottomrule 
\end{tabular} 
\end{subtable}
\end{table}

\pagebreak

\begin{table}[htbp]
\ContinuedFloat
\caption{General caption, continued.}% remove if the second subtible shall not have a general caption
\begin{subtable}{1\textwidth}
\caption{Caption subtable 2}\label{cst2}
\centering
\begin{tabular}{ll}
\toprule
Name & Description\\
\midrule
c & This is c \\ 
d & This is d \\
\bottomrule 
\end{tabular} 
\end{subtable}

\end{table}

\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen