我有两个独立的(不是子图和相关)应该出现的表格对齐在双栏布局格式的论文中垂直排列。我使用了一个表格包装器,然后为每个表格使用了一个小页面(根据无法在 minipage 下使用 \caption 以及许多其他解决方案),但最后一个表格的标题仍然会出现。代码如下:
\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}
和结果(只有 capt2 应该在那里):
我怎样才能看到两个表格的标题,并在视觉上对齐它们?这就是我想要的:
答案1
编辑: 第一个提出的解决方案现已适应添加到您的问题中的新信息:
以上结果是使用您的代码(第一个例子)和使用tabularx
包(第二个例子)产生的。两者都给出了预期的结果,所以不清楚您的问题是什么。如需进一步帮助,请提供重现您问题的 MWE。
\documentclass[11pt,a4paper, twocolumn]{article}
\usepackage{booktabs, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{lipsum }
\begin{document}
% your code with use of dummy tables
\begin{table*}
\begin{minipage}[b]{.55\textwidth}
\centering
\begin{tabular}{ccc}
\toprule
text & text & text \\
\midrule
text text text & text text text & text text text \\
text text text & text text text & text text text \\
\bottomrule
\end{tabular}
\caption{capt 1}
\label{tab1}
\end{minipage}%
\begin{minipage}[b]{.45\textwidth}
\centering
\begin{tabular}{cc}
\toprule
text & text \\
\midrule
text text text & text text text \\
\bottomrule
\end{tabular}
\caption{capt 2}
\label{tab2}
\end{minipage}
% solution with `tabularx and use the same dummy tables as before
\vspace{3\baselineskip}
\begin{tabularx}{\linewidth}{>{\hsize=1.1\hsize}C
>{\hsize=0.9\hsize}C}
\begin{tabular}[b]{ccc}
\toprule
text & text & text \\
\midrule
text text text & text text text & text text text \\
text text text & text text text \\
\bottomrule
\end{tabular} & \begin{tabular}[b]{cc}
\toprule
text & text \\
\midrule
text text text & text text text \\
\bottomrule
\end{tabular} \\[-3ex]
\caption{First table}
& \caption{Second table}
\end{tabularx}
\end{table*}
\end{document}
答案2
表格标题通常放在表格顶部,而图形标题则放在图形下方。您对此有何看法(必须发明您的代码可能是什么样子)?
% tablesprob.tex SE 579912
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\begin{document}
\begin{table*}%[!htb]
\begin{minipage}{.55\textwidth}
\centering
\small
\caption{capt1}
\begin{tabular}{|c|} \hline
An entry \\ \hline
\end{tabular}
% \caption{capt1}
\label{tab1}
\end{minipage}
\begin{minipage}{.45\textwidth}
\centering
\small
\caption{capt2}
\begin{tabular}{|l|r|} \hline
left & right \\ % \hline
LEFT & RIGHT \\ \hline
\end{tabular}
% \caption{capt2}
\label{tab2}
\end{minipage}
\end{table*}
Two tables, \ref{tab1} and \ref{tab2}.
\lipsum[1-10]
\end{document}