如何将两张桌子并排摆放

如何将两张桌子并排摆放

我尝试过使用\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}

这看起来像:

在此处输入图片描述

相关内容