\documentclass{article}
\usepackage[svgnames,table]{xcolor}
\usepackage{nicematrix}
\usepackage{lipsum}
\begin{document}
\begin{NiceTabular}{cc}[color-inside,hvlines]
  1&2\\
  A&\begin{tabular}{|c|c|}
                              \hline
                              Test A&1\\
                              \cellcolor{yellow}Test B&2\\
                              Test C&3\\
                                      \hline
                            \end{tabular}\\
                            3&4\\
                          \end{NiceTabular}
                        \end{document}