Graphics, Figures & TablesCaptions on side-by-side tables using minipage command

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
lnich
Posts: 1
Joined: Sun Jan 09, 2022 1:24 am

Captions on side-by-side tables using minipage command

Post by lnich »

Hi,

I was wondering why I am unable to see table caption using \minipage command: apparently right-side table caption overlaps left-side table caption but I do not understand why. Can someone help me? I leave the Latex code I wrote.

Code: Select all

Code, edit and compile here:
\newcolumntype{x}[1]{>{\centering\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{?}{!{\vrule width 1pt}}
\begin{table}[H]
\tiny
\begin{minipage}[b]{0.4\textwidth}
\centering
\begin{tabular}{?x{26mm}?x{20mm}?}
\Xhline{2.5\arrayrulewidth}
\textbf{Ingredient} & \textbf{WT. Percent} \\ \Xhline{2.5\arrayrulewidth}
R-45M (1\% A02246) & 13.83 \\ \hline
IPDI & 0.86 \\ \hline
HX-752 & 0.30 \\ \hline
TPB & 0.01 \\ \hline
\textit{Mg} & 22.00 \\ \hline
AP & 62.80 \\ \hline
\textit{Fe$_{\,2}$O$_{\,3}$} & 0.20 \\ \Xhline{2.5\arrayrulewidth}
\end{tabular}
\captionof{table}{\textit{Mg} composition}
\label{tab: neutralized composition}
\end{minipage}%
\hspace{7mm}
\begin{minipage}[b]{0.4\textwidth}
\centering
\begin{tabular}{?x{15mm}?x{35mm}?x{22mm}?}
\Xhline{2.5\arrayrulewidth}
\rule{0pt}{14pt}\shortstack{\textbf{Exhaust} \\ \textbf{Products}} & \shortstack{\textbf{Nozzle Exit} \\ (1000 psi - 14.7 psi - 1962 K)} & \shortstack{\textbf{50-50 Air} \\ (14.7 psi - 300 °F)} \\ \Xhline{2.5\arrayrulewidth}
\textit{C$_{\,2}$H$_{\,4}$} & - & 0.128 \\ \hline
\textit{CO} & 1.031 & - \\ \hline
\textit{CO$_{\,2}$} & 0.035 & 0.406 \\ \hline
\textit{HCl} & 0.417 & - \\ \hline
\textit{MgCl$_{\,2}$} & 0.059 & 0.134 \\ \hline
\textit{H$_{\,2}$} & 1.455 & - \\ \hline
\textit{H$_{\,2}$O} & 0.218 & 0.686 \\ \hline
\textit{MgO} & 0.845 & 0.318 \\ \Xhline{2.5\arrayrulewidth}
\end{tabular}
\captionof{table}{\textit{Mg} exhaust products}
\label{tab: neutralized composition}
\end{minipage}
\end{table}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Captions on side-by-side tables using minipage command

Post by Bartman »

More context, please, so that we can reproduce the problem.

Some recommendations for packages that may be useful for the example in some way:
If none of the sets of options of the table environment suits you, then replace it by a minipage in a center environment.

You don't need \captionof in the table environment.

Labels must be unique.
Post Reply