[Tex/LaTex] Putting two tables side by side (one table with subtables)

minipagesubfloatstables

I want to put two tables side by side. Table 1 has two subtables in it. Each table itself is built using the \begin{tabular} environment. A sample of the table is here:

enter image description here

How to do it?

Best Answer

enter image description here

\documentclass{article}
\usepackage{subfig}
\begin{document}
\begin{table}
  \begin{minipage}[t]{0.45\linewidth}
    \centering
    \caption{Caption}
    \subfloat[Type 1]%
      {\begin{tabular}{|c|}
         \hline
         \rule{2cm}{1cm} \\
         \hline
       \end{tabular}
      }

    \subfloat[Type 2]%
      {\begin{tabular}{|c|}
         \hline
         \rule{2cm}{1cm} \\
         \hline
       \end{tabular}
      }
  \end{minipage}
  \hfill
  \begin{minipage}[t]{0.45\linewidth}
    \centering
    \caption{Caption}
    \begin{tabular}{|c|}
      \hline
      \rule{2cm}{1cm} \\
      \hline
    \end{tabular}
  \end{minipage}
\end{table}
\end{document}