I have two independent (not subfigs and related) tables that should appear aligned together vertically in a double-column layout format paper. I used one table wrapper and then minipage for each tabular (according to cannot use \caption under minipage and many other solutions), but the caption still appears for the last table. Here's the code:
\documentclass[11pt,a4paper]{article}
\usepackage{times}
\usepackage{latexsym}
\usepackage{amsmath}
\usepackage{algpseudocode}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{hhline}
\usepackage{arydshln}
\usepackage{url}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage{titlesec}
\usepackage{capt-of}
\usepackage{varwidth}
\usepackage{wrapfig}
\usepackage{ctable}
\usepackage{adjustbox}
\usepackage{float}
\restylefloat{table}
\usepackage{subfiles}
\usepackage{amssymb}
\usepackage{enumitem}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{array}
\usepackage{cleveref}
\usepackage{titlesec}
\usepackage{subfig}
\usepackage{lipsum}
\begin{document}
\begin{table*}[!htb]
\begin{minipage}{.55\textwidth}
\centering
\small
\def\arraystretch{1.0}\tabcolsep=3pt
\begin{tabular}{lcccccccc}
\toprule
& \multicolumn{2}{c}{\textbf{AAA1}} & \multicolumn{2}{c}{\textbf{AAA2}} & \multicolumn{2}{c}{\textbf{AAA3}} & \multicolumn{2}{c}{\textbf{AAA4}}\\
A1 & A2 & A3 & A4 &A5 & A6 & A7 & A8 & A9 \\ \toprule
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\midrule
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\textsc{BLAAAAA} & - & - & - & - & - & - & - & - \\
\bottomrule
\end{tabular}
\caption{Capt1}
\label{tab:1}
\end{minipage}
\begin{minipage}{.45\textwidth}
% \subfloat[First caption]{
\centering
\small
\def\arraystretch{1.0}\tabcolsep=3pt
\begin{tabular}{@{}lrrr@{}}
\toprule
A1 & A2 & A3 & A4 \\ \midrule
BLAAAAA & - & - & - \\
BLAAAAA & - & - & - \\
BLAAAAA & - & - & - \\
BLAAAAA & - & - & - \\
BLAAAAA & - & - & - \\
BLAAAAA & - & - & - \\
\bottomrule
\end{tabular}
% \end{table}
\caption{Capt2.}
\label{tab:2}
\end{minipage}
\end{table*}
\end{document}
and the results (only capt2 should be there):
How can I see the captions of the two tables, and also align them visually? Here's what I want:
\documentclass{twocolumn]{article}
and ended up with two captions, just as expected.) Therefore, please prepare a minimal working example (MWE) in order to allow others to reproduce the issue you describe.\documentclass[11pt,a4paper]{article}
alone results in a single column document. In your question you mention using a "double column" layout. Please clarify that.\documentclass...
to\end{document}
) that we can compile and which shows your problem. Is it a one or two column document? Both captions should appear. I'm confused as at one point you only wanted cap2 but then you wanted both cap1 and cap2.