I have a tabular with 4 sub-figures and I want to set the caption for each figure respectively. I'm using the subcaption package but I'm getting the following error on compilation: package floatrow error: caption(s) lost. Can anyone tell where the problem is?
{\centering
\begin{table}[ht]
\begin{tabular}{ll}
\begin{subfigure}{}
\includegraphics[width=0.5\columnwidth]{include/case_study/fig/QQ_Velocity.png} \caption{figure} \label{fig:taba2}
\end{subfigure} &
\begin{subfigure}{}
\includegraphics[width=0.5\columnwidth]{include/case_study/fig/QQ_Velocity.png} \caption{fd} \label{fig:taba3}
\end{subfigure}\\ \newline
\begin{subfigure}{}
\includegraphics[width=0.5\columnwidth]{include/case_study/fig/QQ_Velocity.png} \caption{figure}\label{fig:taba4}
\end{subfigure} &
\begin{subfigure}{}
\includegraphics[width=0.5\columnwidth]{include/case_study/fig/QQ_Velocity.png} \caption{figure} \label{fig:taba5}
\end{subfigure}\\
\end{tabular}
\caption{A table with figures}
\label{tab:mytable}
\end{table}
}
Best Answer
I can't reproduce your error. However, you have errors in defining of
subfigure
. For it you need to declare its width, for exampleIn it you than can set width of figure relative to
subfigure
width, for example:Also the
\centering
should be inside oftable
environment. Complete code: