\documentclass{jarticle}
\usepackage{array}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\usepackage[table]{xcolor}

\begin{document}
\begin{figure}
    \centering
\setlength\tabcolsep{0pt}
\begin{tabular}{|@{\rule[-0.4cm]{0pt}{1cm}}*{3}{M{1cm} |}}
    \hline
A & B & C \\
    \hline
D & \cellcolor[HTML]{ff0000} & \cellcolor[HTML]{00ff00} \\
    \hline
E & F & G \\
    \hline
    \end{tabular}
\caption{Squares}
    \label{Squares}
    \end{figure}
\end{document} 