This is merely to honorably mention the amazing `circledsteps` package, which is written by an [amazing squirrel](https://topanswers.xyz/user?id=809&community=tex). :smile_cat: It seems to me that you have reached the point at which you might want to use the circles inside nodes of a `tikzpicture`. However, this prevents you from using a `tikzpicture` for creating these circles as this would mean that you nest `tikzpicture`s (unless you want to use `\savebox`es or play Russian roulette). On the other hand, with the circles created by `circlesteps` there is no problem. (I also think that these circles compile a tiny bit faster, but this is almost impossible to measure.) Then you can use the `matrix` library to create the tables, and to relatively align them to each other.
```
\documentclass[xcolor={rgb}]{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamersize{text margin left=10mm,text margin right=5mm}
\setbeamertemplate{frametitle}[default][center]
\usepackage{circledsteps}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newcommand{\mycircle}[1][1]{%
\Circled[fill color={foo!![#1]},outer color=blue!60]{\phantom{o}}}%
\def\numcolors{4}
\pgfmathparse{1/\numcolors}%
\definecolorseries{foo}{hsb}{step}{red!90!black}{\pgfmathresult,0,0}
\resetcolorseries[\numcolors]{foo}%
\begin{document}
\begin{frame}
\frametitle{Using \texttt{circledsteps}}
\centering
\begin{tikzpicture}
\node (crow) {\def\numdots{8}%
\def\cols{1,2,3,4,1,2,3,4}
\foreach \x in {1,...,\numdots}{%
\pgfmathtruncatemacro{\mycf}{{\cols}[\x-1]}%
\mycircle[\mycf]\;%
}%
};
\path ([yshift=-1cm]crow.south) node[below right,matrix of nodes,
ampersand replacement=\&,nodes in empty cells,
cells={nodes={fill=blue!10,draw=white,minimum width=3em,text height=0.8em}},
column 1/.style={nodes={fill=none,draw=none,minimum width=0em}}
] (mat1) {%
h1 \& ~ \& ~ \& ~\\
h2 \& ~ \& ~ \& ~\\
};
\path ([xshift=1cm]mat1.south east)
node[above right,matrix of nodes,
ampersand replacement=\&,nodes in empty cells,
cells={nodes={draw=white,minimum width=3em,text height=0.8em,text depth=0.25ex}},
every even row/.style={nodes={fill=blue!20}},
every odd row/.style={nodes={fill=blue!10}}] (mat1) {%
|[fill=blue!50]| \& |[fill=blue!50]| h1,g1 \& |[fill=blue!50]| h2,g2\\
\mycircle[1] \& 2,+\& 1,+\\
\mycircle[2] \& 3,-\& 2,+\\
\mycircle[3] \& 1,+\& 3,-\\
\mycircle[4] \& 2,-\& 3,+\\
};
\end{tikzpicture}
\end{frame}
\end{document}
```

There are various things that one can change/improve, such as the programmatic coloring of the tables. (I am aware of the fact that there are users who find this too hacky, which is why there is also the above code.)
```
\documentclass[xcolor={rgb}]{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamersize{text margin left=10mm,text margin right=5mm}
\setbeamertemplate{frametitle}[default][center]
\usepackage{circledsteps}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newcommand{\mycircle}[1][1]{%
\Circled[fill color={foo!![#1]},outer color=blue!60]{\phantom{\mbox{o}}}}%
\def\numcolors{4}
\pgfmathparse{1/\numcolors}%
\definecolorseries{foo}{hsb}{step}{red!90!black}{\pgfmathresult,0,0}
\resetcolorseries[\numcolors]{foo}%
\begin{document}
\begin{frame}
\frametitle{Using \texttt{circledsteps}}
\centering
\begin{tikzpicture}
\node (crow) {\def\numdots{8}%
\def\cols{1,2,3,4,1,2,3,4}
\foreach \x [count=\y] in {1,...,\numdots}{%
\pgfmathtruncatemacro{\mycf}{{\cols}[\x-1]}%
\ifnum\y>1\relax\;\fi\mycircle[\mycf]%
}%
};
\path ([yshift=-1cm]crow.south)
[cond/.code={%
\ifnum\pgfmatrixcurrentcolumn>1\relax
\tikzset{fill=blue!10,draw=white,minimum width=3em,
text height=0.8em,text depth=0.2ex}%
\fi}]
node[below right,matrix of nodes,
ampersand replacement=\&,nodes in empty cells,nodes={cond}
] (mat1) {%
$h_1$ \& \& \& \\
$h_2$ \& \& \& \\
};
\path ([xshift=1cm]mat1.south east)
[cond/.code={%
\ifnum\pgfmatrixcurrentrow=1\relax
\tikzset{fill=blue!50,text=white}%
\else
\ifodd\pgfmatrixcurrentrow
\tikzset{fill=blue!10}%
\else
\tikzset{fill=blue!20}%
\fi
\fi}]
node[above right,matrix of math nodes,
ampersand replacement=\&,nodes in empty cells,
cells={nodes={draw=white,minimum width=3em,
text height=0.8em,text depth=0.25ex,cond}}] (mat1) {%
\& h_1,g_1 \& h_2,g_2\\[0.2ex]
\mycircle[1] \& 2,+\& 1,+\\
\mycircle[2] \& 3,-\& 2,+\\
\mycircle[3] \& 1,+\& 3,-\\
\mycircle[4] \& 2,-\& 3,+\\
};
\end{tikzpicture}
\end{frame}
\end{document}
```
