我尝试过使用\quad
,\subfloat
但仍然无法让它工作。下面是我写的代码。
\begin{table}[h!]
\ centering
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} \\
\hline
Monomer & 14.1 \\
\hline
Dimers & 85.9 \\
\hline
Homodimers & 61.2 \\
\hline
Heterodimers & 24.6 \\
\hline
\end{tabular}
\caption{Sample 1: ApoE dimer profile (\%)}
\label{tab:my_label}
\end{table}
\begin{table}[h!]
\centering
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} & \textbf{CM} \\
\hline
Monomer & 59.8 & 1 \\
\hline
Dimers & 40.2 & 99 \\
\hline
Homodimers & 9.6 & 99 \\
\hline
Heterodimers& 30.6 & 0 \\
\hline
\end{tabular}
\caption{Sample 2: ApoE dimer profile (\%)}
\label{tab:my_label}
\end{table}
答案1
您可以使用以下floatrow
软件包轻松完成此操作:
\documentclass{article}
\usepackage{floatrow}
\begin{document}
\begin{table}[h!]
\begin{floatrow}
\centering
\ttabbox{ \caption{Sample 1: ApoE dimer profile (\%)} \label{tab:my_label}}%
{\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} \\
\hline
Monomer & 14.1 \\
\hline
Dimers & 85.9 \\
\hline
Homodimers & 61.2 \\
\hline
Heterodimers & 24.6 \\
\hline
\end{tabular}}
\qquad
\ttabbox{ \caption{Sample 2: ApoE dimer profile (\%)} \label{tab:my_label}}%
{\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} & \textbf{CM} \\
\hline
Monomer & 59.8 & 1 \\
\hline
Dimers & 40.2 & 99 \\
\hline
Homodimers & 9.6 & 99 \\
\hline
Heterodimers& 30.6 & 0 \\
\hline
\end{tabular}}
\end{floatrow}
\end{table}
\end{document}
答案2
这可能会有帮助。
\documentclass{article}
\begin{document}
\begin{tabular}{lr}
Sample 1: ApoE dimer profile (\%) & Sample 2: ApoE dimer profile (\%)\\
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} \\
\hline
Monomer & 14.1 \\
\hline
Dimers & 85.9 \\
\hline
Homodimers & 61.2 \\
\hline
Heterodimers & 24.6 \\
\hline
\end{tabular} \label{tab:my_label}
&
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} & \textbf{CM} \\
\hline
Monomer & 59.8 & 1 \\
\hline
Dimers & 40.2 & 99 \\
\hline
Homodimers & 9.6 & 99 \\
\hline
Heterodimers& 30.6 & 0 \\
\hline
\end{tabular} \label{tab:my_label1}\\
\end{tabular}
\end{document}
编辑: 这是您的代码。谢谢。
\documentclass{article}
\usepackage{caption}
\captionsetup[table]{position=bottom}
\begin{document}
\begin{tabular}{lr}
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} \\
\hline
Monomer & 14.1 \\
\hline
Dimers & 85.9 \\
\hline
Homodimers & 61.2 \\
\hline
Heterodimers & 24.6 \\
\hline
\end{tabular} \label{tab:my_label}
&
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dimer profile} & \textbf{CP} & \textbf{CM} \\
\hline
Monomer & 59.8 & 1 \\
\hline
Dimers & 40.2 & 99 \\
\hline
Homodimers & 9.6 & 99 \\
\hline
Heterodimers& 30.6 & 0 \\
\hline
\end{tabular}\label{tab:my_label}\\
Sample 2: ApoE dimer profile (\%) & Sample 1: ApoE dimer profile (\%)
\end{tabular}
\end{document}
这看起来像: