In the following example, I want to generate Table 3.1: AAA as the caption instead of the plain title AAA. To clarify further, I do not want teh caption to be place above or below the table, but the title should be substituted by the caption text. Any idea on how to achieve that?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fancy table
% http://tex.stackexchange.com/questions/112343/beautiful-table-samples
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{array}
\usepackage{colortbl}
\tcbuselibrary{skins}
\usepackage{multirow}
\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}
\newcolumntype{Z}{>{\centering\arraybackslash}X}
\tcbset{tab2/.style={enhanced,fonttitle=\bfseries,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=red!50!black,colbacktitle=Salmon!40!white,
coltitle=black,center title}}
\begin{document}
\begin{tcolorbox}[tab2,tabularx={Z || Z | Z | Z},title=AAA,width=0.7\textwidth]
BBB & BBB & BBB & BBB \\ \hline\hline
\multirow{3}{*}{XXX} & AAA & AAA & AAA \\ \cline{2-4}
& & AAA & AAA \\ \cline{2-4}
& & AAA & AAA
\end{tcolorbox}
\end{document}


skip=0ptfromcaption, and used theafter titleandbefore titlekeys instead. Please see my updated answer. However, it shouldn't be so tight in my opinion. – Bernard Dec 01 '16 at 18:03