# How to add a force nested tables

I have some data tables and I want to add a force nested table, i.e. something like the following:

after reading the comments tex.stackexchange.com/a/5770, this solution is not suitable for my purposes : 1- I need to show in the caption Table instead of Figure on both sides. 2- the table doesn't show up, by using Figure tag.

code :

                \documentclass[a4paper,12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{array}
\usepackage{makecell}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}

\begin{document}

\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering
\begin{table}
\begin{tabular}{|c|c|c|c|}
\hline
& & & \\
\hline
AAA&65.77&85.42&51.35\\
AAT&4.6&59.4&0.6\\
\hline
Mean&39.8&39.8&39.8\\
\hline
\end{tabular}
\end{table}
\caption{Table 1}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{example-image-b} % second figure itself
\caption{second figure}
\end{minipage}
\end{figure}

\end{document}

• Welcome to Tex.SX Could you please post an MWE – Thorbjørn E. K. Christensen Mar 12 '18 at 11:46
• Hi, welcome. That is similar to tex.stackexchange.com/a/5770 (just replace figure with table, and add a tabular instead of \includegraphics). – Torbjørn T. Mar 12 '18 at 11:46
• welcome to tex.se! what is the problem? where you stuck, when you try to write your table? – Zarko Mar 12 '18 at 11:47
• Sir @TorbjørnT. I have tested that, but no good results – azdoud Mar 12 '18 at 11:54
• Then can you show us what you have tried, and explain what is wrong with the result? – Torbjørn T. Mar 12 '18 at 11:55

Thanks to @Torbjørn T

The solution is :

    \documentclass[a4paper,12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{array}
\usepackage{makecell}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}

\begin{document}

\begin{table}

\centering
\begin{minipage}{0.45\textwidth}
\centering

\begin{tabular}{|c|c|c|c|}
\hline
& & & \\
\hline
AAA&65.77&85.42&51.35\\
AAT&4.6&59.4&0.6\\
\hline
Mean&39.8&39.8&39.8\\
\hline
\end{tabular}

\caption{Average errors}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\centering

\begin{tabular}{|c|c|c|c|}
\hline
& & & \\
\hline
AAA&65.77&85.42&51.35\\
AAT&4.6&59.4&0.6\\
\hline
Mean&39.8&39.8&39.8\\
\hline
\end{tabular}

\caption{Average success}
\end{minipage}

\end{table}
\end{document}