Another way to do this is the following
\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}
\begin{document}
\begin{center}
\begin{tikzpicture}
\foreach \x in {0,2,...,6} \draw[thick] (\x,0)--(\x,6);
\foreach \x in {0,2,...,6} \draw[thick] (0,\x)--(6,\x);
\node at (1.5,1.5) {$g$};
\node at (3.5,1.5) {$h$};
\node at (5.5,1.5) {$i$};
\node at (1.5,3.5) {$d$};
\node at (3.5,3.5) {$e$};
\node at (5.5,3.5) {$f$};
\node at (1.5,5.5) {$a$};
\node at (3.5,5.5) {$b$};
\node at (5.5,5.5) {$c$};
\color{magenta}
\draw[thick,-] (8,2.5)--(0,2.5);
\color{cyan}
\draw[thick,-] (5,6)--(5,0);
\color{green}
\draw[thick,->] (.5,0)--(.5,7);
\end{tikzpicture}
\end{center}
\end{document}
Displays

NOTE. In this case I'm not using the environment table as you did. Take this as an alternative to display the same result.
I did this, inspired by the answer by @JoséCarlosSantos in his answer to my question How can I add this arrows and numbers inside a table?
\usepackage[table, svgnames]{xcolor}marks an error saying "Option clash for package xcolor" ? I then deletedusepackage{xcolor}but the error doesn't go away, it's still there – I likeThatMeow Nov 28 '19 at 23:00xcolor, possibly via some package (TikZ, beamer, …), and with another or no option at all. A simple remedy consists in passing this option through the\documentclass. – Bernard Nov 28 '19 at 23:05