3

I'd like to have two tabulars side by side in threeparttable environment which is also in table environment due to floating option. However I am getting the tabulars one on top of the other. I prefer explicitly to have the threeparttable environment because of the easier use of table notes. Here is my code:

\begin{table}[hbtp]
\caption{Participation Rates by Demographic Group} 
\label{participation_rates}
\centering
\footnotesize
\begin{threeparttable}
\begin{tabular}{cccc} \hline \hline 
\multicolumn{4}{c}{First Order Rates} \\
&       &       &  \\
&       & \multicolumn{2}{c}{ mother's education} \\
&       & hs less & coll more \\
&       &       &  \\
\multirow{2}[0]{*}{single} & black & 0.7983 & 0.6165 \\
& white & 0.6105 & 0.4144 \\
&       &       &  \\
&       &       &  \\
\multirow{2}[0]{*}{married} & black & 0.3286 & 0.1946 \\
& white & 0.1938 & 0.1118 \\ \hline \hline 
\end{tabular}
\hfill
\begin{tabular}{cccc} \hline \hline 
\multicolumn{4}{c}{Second Order Rates} \\
&       &       &  \\
&       & \multicolumn{2}{c}{ mother's education} \\
&       & hs less & coll more \\
&       &       &  \\
\multirow{2}[0]{*}{single} & black & 0.6502 & 0.4230 \\
& white & 0.4547 & 0.2695 \\
&       &       &  \\
&       &       &  \\
\multirow{2}[0]{*}{married} & black & 0.2789 & 0.1438 \\
& white & 0.1562 & 0.06453 \\ \hline \hline 
\end{tabular} 
\begin{tablenotes}
\footnotesize
\item Here are some table notes...
\end{tablenotes}
\end{threeparttable}
\end{table}
  • Off-topic: the statement \begin{threeparttable} should be placed before the \caption statement. Why? The three formal parts of a threeparttable environment are the caption, a tabular-like environment, and the tablenotes environment. – Mico Feb 22 at 8:49
4

Enclose both four-column tables in an "outer", two-column tabular environment:

\documentclass{article}
\usepackage{multirow, threeparttable}

\begin{document}
\begin{table}[hbtp]
\begin{threeparttable}
\caption{Participation Rates by Demographic Group}
\label{participation_rates}
\centering
\footnotesize
\begin{tabular}{cc} % <-- new
\begin{tabular}{cccc} \hline \hline
\multicolumn{4}{c}{First Order Rates} \\
&       &       &  \\
&       & \multicolumn{2}{c}{ mother's education} \\
&       & hs less & coll more \\
&       &       &  \\
\multirow{2}[0]{*}{single} & black & 0.7983 & 0.6165 \\
& white & 0.6105 & 0.4144 \\
&       &       &  \\
&       &       &  \\
\multirow{2}[0]{*}{married} & black & 0.3286 & 0.1946 \\
& white & 0.1938 & 0.1118 \\ \hline \hline
\end{tabular}
 & 
\begin{tabular}{cccc} \hline \hline
\multicolumn{4}{c}{Second Order Rates} \\
&       &       &  \\
&       & \multicolumn{2}{c}{ mother's education} \\
&       & hs less & coll more \\
&       &       &  \\
\multirow{2}[0]{*}{single} & black & 0.6502 & 0.4230 \\
& white & 0.4547 & 0.2695 \\
&       &       &  \\
&       &       &  \\
\multirow{2}[0]{*}{married} & black & 0.2789 & 0.1438 \\
& white & 0.1562 & 0.06453 \\ \hline \hline
\end{tabular}
\end{tabular} % <-- new

\begin{tablenotes}
\footnotesize
\item Here are some table notes...
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

enter image description here

|improve this answer|||||
3

As you've (re-)discovered, the threeparttable environment uses the width of the very first tabular-like environment to determine the width of the other two main elements -- the caption and the tablenotes environment. Because threeparttable expects to "see" just one tabular environment, it forces a line-break ahead of the second tabular environment in your code.

Assuming you want to keep the threeparttable machinery and hence must make it believe that there's just a single tabular for it to deal with, you could proceed as follows:

  • Use @Zarko's approach and embed the two four-column environments in an "outer" 2-column tabular environment.

  • Set up a single-column "outer" tabular environment and nest in it a minipage of width \textwidth. This approach is explained in greater detail below.

The second approach has an important advantag: it permits a natural use of subtable environments (provided by the subcaption package). The following code shows how this might be done. Note how I've given both tables more explicit visual structure and that it's no longer necessary to resort to \footnotesize to "squeeze" both tables next to each other.

enter image description here

\documentclass{article}
\usepackage{multirow,threeparttable}
\renewcommand\TPTtagStyle{\textit}

\usepackage{booktabs,subcaption}
\captionsetup[subtable]{skip=0.25\baselineskip} % optional

\begin{document}
\begin{table}[hbtp]
\begin{threeparttable}

%% Part 1 of 3: the caption
\caption{Participation Rates by Demographic Group} 
\label{tab:participation_rates}

%% Part 2 of 3: the tabular-like structure
\begin{tabular}{@{}c@{}} % dummy "outer" tabular env.
\begin{minipage}{\textwidth}

\begin{subtable}[b]{0.48\textwidth}
\caption*{First Order Rates} 
\begin{tabular}{@{} llcc @{}} 
\toprule
& & \multicolumn{2}{c@{}}{mother's education} \\
\cmidrule(l){3-4}
& & hs\slash less\tnote{a} & coll\slash more \\
\midrule
\multirow{2}{*}{single\tnote{b}}  
   & black & 0.7983 & 0.6165 \\
   & white & 0.6105 & 0.4144 \\
\addlinespace
\multirow{2}{*}{married\tnote{c}} 
   & black & 0.3286 & 0.1946 \\
   & white & 0.1938 & 0.1118 \\ 
\bottomrule 
\end{tabular}
\end{subtable}%
\hfill
\begin{subtable}[b]{0.48\textwidth}
\caption*{Second Order Rates} 
\raggedleft % flush to right-hand edge of text block
\begin{tabular}{@{} llcc @{}} 
\toprule
& & \multicolumn{2}{c@{}}{mother's education} \\
\cmidrule(l){3-4}
& & hs\slash less\tnote{a} & coll\slash more \\
\midrule
\multirow{2}{*}{single\tnote{b}}  
   & black & 0.6502 & 0.4230 \\
   & white & 0.4547 & 0.2695 \\
\addlinespace
\multirow{2}{*}{married\tnote{c}} 
   & black & 0.2789 & 0.1438 \\
   & white & 0.1562 & 0.0645 \\ 
\bottomrule
\end{tabular}
\end{subtable}

\end{minipage}
\end{tabular} % end of dummy "outer" tabular env.

%% Part 3 of 3: the tablenotes environment
\smallskip
\footnotesize
\begin{tablenotes}[flushleft]
\item[a] Some notes \dots
\item[b] Some more notes \dots
\item[c] Still more notes \dots
\end{tablenotes}

\end{threeparttable}
\end{table}
\end{document}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.