I have 4 sub tables inside a table environment. The sub tables are too far to the right and the sub caption for the sub tables is also not centered below the sub tables. Any help will be appreciated.
\begin{table} [htp]
\centering
\begin{subtable}[c]{.5\textwidth}
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline Class & Recall & FP & Precision & F-Measure & MCC \\
\hline normal & 0.924 & 0.380 & 0.648 & 0.762 & 0.554 \\
\hline anomaly & 0.620 & 0.076 & 0.915 & 0.739 & 0.554 \\
\hline
Weighted Avg. & 0.751 & 0.207 & 0.800 & 0.749 & 0.554 \\
\hline
\end{tabular}
\caption{SVM-Linear Performance Metrics \label{tbl:svmlinearaccuracy}}
\vspace{10mm}
\end{subtable}
\quad%
\begin{subtable}[c]{.5\textwidth}
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline Class & Recall & FP & Precision & F-Measure & MCC \\
\hline normal & 0.967 & 0.391 & 0.652 & 0.779 & 0.594 \\
\hline anomaly & 0.609 & 0.033 & 0.961 & 0.745 & 0.594 \\
\hline
Weighted Avg. & 0.763 & 0.187 & 0.828 & 0.760 & 0.594 \\
\hline
\end{tabular}
\caption{SVM-Polynomial Performance Metrics \label{tbl:svmpolynomialaccuracy}}
\vspace{10mm}
\end{subtable}
\quad%
\begin{subtable}[c]{.5\textwidth}
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline Class & Recall & FP & Precision & F-Measure & MCC \\
\hline normal & 0.925 & 0.403 & 0.635 & 0.753 & 0.534 \\
\hline anomaly & 0.597 & 0.075 & 0.913 & 0.722 & 0.534 \\
\hline
Weighted Avg. & 0.738 & 0.216 & 0.793 & 0.735 & 0.534 \\
\hline
\end{tabular}
\caption{SVM Sigmoid Performance Metrics \label{tbl:svmsigmoidaccuracy}}
\vspace{10mm}
\end{subtable}
\quad%
\begin{subtable}[c]{.5\textwidth}
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline Class & Recall & FP & Precision & F-Measure & MCC \\
\hline normal & 0.924 & 0.409 & 0.631 & 0.750 & 0.528 \\
\hline anomaly & 0.591 & 0.076 & 0.911 & 0.717 & 0.528 \\
\hline
Weighted Avg. & 0.734 & 0.220 & 0.790 & 0.731 & 0.528 \\
\hline
\end{tabular}
\caption{SVM RBF Performance Metrics \label{tbl:svmrbfaccuracy}}
\vspace{10mm}
\end{subtable}
\caption{Main Table}
\end{table}
Best Answer
Your table includes subtables which are too broad to fit two on one line. And they are too broad for the
.5\textwidth
. Hence you should increase that subtable width to\textwidth
and remove the\quad
macros (replace them with\\
).Then you should have the right formatting. Actually they are formatted correctly, because the caption is centered across the
.5\textwidth
.