# Two tables side by side with independent and global captions

I want to put two tables side by side in my document, with (a) and (b) subcaptions for them, and also a global caption "Table 1. Blahblahblah" (spanning to one of the columns only). At the moment I am only able to put the tables with independent captions (as seen in the image below). I've tried the subcaption package and subtable but it claims that subtable environment was undefined. I've also tried the subfigure package but it clashes with the subfig package.

\documentclass[conference]{IEEEtran}
\thispagestyle{plain}   % To force page numbering when using conference IEEEtran
\pagestyle{plain}   % To force page numbering when using conference IEEEtran
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\newcommand{\subfigureautorefname}{\figureautorefname}  % For autoref to name subfloats as Figure
\renewcommand{\tablename}{Table}

%%%%%%%%%% FIGURES %%%%%%%%%%%
\usepackage[justification=centering]{caption}   % Figures caption
\usepackage{graphicx}
\captionsetup{labelsep = period}  % Figure 2. Caption (rather than Figure 2: Caption)
\usepackage{float}  % To place figures where I want with [H]
\usepackage{subfig} % For subfigures
\renewcommand{\figurename}{Fig.}  % Fig.2 (rather than Figure 2)

\begin{document}
\begin{table}[H]
\centering
\begin{subfloat}
\centering
\begin{tabular}{|c|c|}
\hline
\textbf{h [m]} & \textbf{dim [m]} \\ \hline
30 & 0.75 \\ \hline
50 & 1.25 \\ \hline
70 & 1.75 \\ \hline
100 & 2.50 \\ \hline
\end{tabular}
\caption{Minimum dimension of an object for it to be detected by the FFT algorithm at different heights}
\label{tab:dimFFT}
\end{subfloat}%
\begin{subfloat}
\centering
\begin{tabular}{|c|c|}
\hline
\textbf{h [m]} & \textbf{dim [m]} \\ \hline
30 & 0.28 \\ \hline
50 & 0.47 \\ \hline
70 & 0.66 \\ \hline
100 & 0.94 \\ \hline
\end{tabular}
\caption{Minimum dimension of an object for it to be detected by the GMM algorithm at different heights}
\label{tab:dimGMM}
\end{subfloat}
\end{table}
\end{document}


What I currently get:

I want something like this below but adding (a) and (b) subcaptions:

Thank you

It works with either subcaption:

or with floatrow (which makes it easy to have side captions):

I supposed you wanted the row of subtables to be display across both columns. Here's the code, which I commented for the floatrow version:

\documentclass[conference]{IEEEtran}
\thispagestyle{plain} % To force page numbering when using conference IEEEtran
\pagestyle{plain} % To force page numbering when using conference IEEEtran
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\newcommand{\subfigureautorefname}{\figureautorefname} % For autoref to name subfloats as Figure
\renewcommand{\tablename}{Table}

%%%%%%%%%% FIGURES %%%%%%%%%%%
\usepackage[justification=centering]{caption} % Figures caption
\usepackage{graphicx}
\captionsetup{labelsep = period} % Figure 2. Caption (rather than Figure 2: Caption)
%\usepackage{float} % To place figures where I want with [H]
\renewcommand{\figurename}{Fig.} % Fig.2 (rather than Figure 2)
\usepackage{caption, subcaption, floatrow}

\begin{document}

\begin{table*}%[H]
\centering
\captionsetup[subtable]{position = below}
\captionsetup[table]{position=top}
\caption{Blahblah}
\begin{subtable}{0.3\linewidth}
\centering
\begin{tabular}{|c|c|}
\hline
\textbf{h [m]} & \textbf{dim [m]} \\ \hline
30 & 0.75 \\ \hline
50 & 1.25 \\ \hline
70 & 1.75 \\ \hline
100 & 2.50 \\ \hline
\end{tabular}
\caption{Minimum dimension of an object for it to be detected by the FFT algorithm at different heights}
\label{tab:dimFFT}
\end{subtable}%
\hspace*{4em}
\begin{subtable}{0.3\linewidth}
\centering
\begin{tabular}{|c|c|}
\hline
\textbf{h [m]} & \textbf{dim [m]} \\ \hline
30 & 0.28 \\ \hline
50 & 0.47 \\ \hline
70 & 0.66 \\ \hline
100 & 0.94 \\ \hline
\end{tabular}
\caption{Minimum dimension of an object for it to be detected by the GMM algorithm at different heights}
\label{tab:dimGMM}
\end{subtable}
\end{table*}
%
% \begin{table*}%[H]
%             \centering
%             \floatsetup[subtable]{capposition=beside, capbesideposition=bottom, capbesidesep=none}
%             \floatsetup[table]{capposition= top}
%             \captionsetup[subtable]{justification =justified}
%             \ttabbox[\FBwidth]
%             {\begin{subfloatrow}
%                 \ttabbox[1.25\FBwidth]{\caption{Minimum dimension of an object for it to be detected by the FFT algorithm at different heights}
%                 \label{tab:dimFFT1}}%
%                 {\begin{tabular}{|c|c|}
%                     \hline
%                     \textbf{h [m]} & \textbf{dim [m]} \\ \hline
%                     30 & 0.75 \\ \hline
%                     50 & 1.25 \\ \hline
%                     70 & 1.75 \\ \hline
%                     100 & 2.50 \\ \hline
%                 \end{tabular}}
%             \ttabbox[1.25\FBwidth]{ \caption{Minimum dimension of an object for it to be detected by the GMM algorithm at different heights}
%                 \label{tab:dimGMM1}}
%                 {\begin{tabular}{|c|c|}
%                     \hline
%                     \textbf{h [m]} & \textbf{dim [m]} \\ \hline
%                     30 & 0.28 \\ \hline
%                     50 & 0.47 \\ \hline
%                     70 & 0.66 \\ \hline
%                     100 & 0.94 \\ \hline
%                 \end{tabular}}
%             \end{subfloatrow}}%
%             {\caption{Blahblah}}
%         \end{table*}

\end{document}

• Thank you, your first option is exactly what I want. However, I get this error when adding the subcaption package. I need the subfig package for some other figures I have with subfloats. Package subcaption Error: This package can't be used in cooperation(subcaption) with the subfig package. \endinput}{} – Zynk Jul 28 '16 at 15:07
• And you really can't do without subfig? – Bernard Jul 28 '16 at 16:28
• How then can I put my images with subfloat? It doesn't work without subfig and I don't know another way... – Zynk Jul 29 '16 at 10:06
• But why do you need subfloat? Subcaption also has a subfigureenvironment, you can define new subfloat types. Floatrow (which cooperates with subcaption, but has more possibilities) has its own commands too. – Bernard Jul 29 '16 at 11:15