副標題與主標題並排表格

副標題與主標題並排表格
   [http://tex.stackexchange.com/questions/350810/side-by-side-tables-of-unequal-height-alignment][1]

我想為每個表格添加子標題和主標題。

[1]:我的程式碼和圖片在這裡

答案1

使用subtable環境,來自subcaption

    \documentclass[11pt]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{geometry}
    \usepackage{caption, subcaption}

    \begin{document}

\begin{table}[!htb]
\begin{subtable}{0.4\linewidth}
\centering
  \begin{tabular}{||c c c c c c||}
 \hline
 -- &A & B&C&D&E\ \\ [0.5ex]
 \hline\hline
 T1& 10 & 12 & 14 & 45 &87 \\
 \hline
 T2& 10 & 12 & 14 & 45 &87\\
 \hline
 T3& 10 & 12 & 14 & 45 &87\\
 \hline
 T4& 10 & 12 & 14 & 45 &87\\
 \hline
 T5& 10 & 12 & 14 & 45 &87\\
 \hline
 T6& 10 & 12 & 14 & 45 &87\\
 \hline
 T7& 10 & 12 & 14 & 45 &87\\[1ex]
 \hline\hline
\end{tabular}
\caption{First subtable}\label{table 1}
\end{subtable}
\hfill$\Rightarrow$\hfill\mbox{}
\begin{subtable}{0.4\linewidth}
\centering
\begin{tabular}{||c c c c c c||}
 \hline
 -- &A & B&C&D&E\ \\ [0.5ex]
 \hline\hline
 $<$T1,T2$>$& 10 & 12 & 14 & 45 &87 \\
 \hline
 $<$T1,T3$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T1,T4$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T1,T5$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T1,T6$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T1,T7$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T2,T3$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T2,T4$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T2,T5$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T2,T6$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T2,T7$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T3,T4$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T3,T5$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T3,T6$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T3,T7$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T4,T5$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T4,T6$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T4,T7$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T5,T6$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T5,T7$>$& 10 & 12 & 14 & 45 &87\\
 \hline
 $<$T6,T7$>$& 10 & 12 & 14 & 45 &87\\ [1ex]
 \hline\hline
\end{tabular}
\caption{Second subtable}\label{table 2}
\end{subtable}
\caption{Database Instance}\label{table:dbi1}
\end{table}

    \end{document} 

在此輸入影像描述

相關內容