I'm trying to put a figure (with \tabular) inside a table (\tabular):

I've tried the code:

```
\begin{tabular}{cc}
    \begin{figure}
        \begin{tabular}{ccc}
            \includegraphics[width=0.16\linewidth]{example-image} &  
            \includegraphics[width=0.16\linewidth]{example-image} &
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{tabular}
        \caption{Some text}
    \end{figure}
    &
    \begin{figure}
        \begin{tabular}{ccc}
            \includegraphics[width=0.16\linewidth]{example-image} &  
            \includegraphics[width=0.16\linewidth]{example-image} &
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{tabular}
        \caption{Some text}
    \end{figure}
\end{tabular}

```

and

```
\begin{table}{cc}
    \begin{figure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
                \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \caption{Some text}
    \end{figure}
&
    \begin{figure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
                \begin{subfigure}
            \includegraphics[width=0.16\linewidth]{example-image}
        \end{subfigure}
        \caption{Some text}
    \end{figure}
\end{table}

```

both of these code blocks make an error.

I'm trying to make it look like this:
[![enter image description here](https://i.stack.imgur.com/RWsL8.png)](https://i.stack.imgur.com/RWsL8.png)

Thanks!