How to colour a table with opaque colour such that no text and no lines are visible?

\color{green} before the table will color the lines and text

\documentclass[border=3.14]{standalone}
\usepackage[table]{xcolor}
\begin{document}
\colorbox{green}{
\color{green}
\begin{tabular}{| c | c |}
  a & b \\
  c & d \\
\end{tabular}}
\end{document}

I'm not sure whether I understood your question correctly or not. The following typesets its argument inside a box and outputs a green box which has the same size as the argument would have had.

\documentclass[]{article}

\usepackage{xcolor}
\usepackage{grabbox}

\newsavebox\overgreenboxBox
\newcommand*\overgreenbox
  {%
    \grabbox\overgreenboxBox\hbox
      {%
        \textcolor{green}
          {%
            \vrule
              height \ht\overgreenboxBox
              depth \dp\overgreenboxBox
              width \wd\overgreenboxBox
          }%
      }%
  }

\begin{document}
\overgreenbox{\begin{tabular}{| c | c |}a&b\\c&d\\\end{tabular}}
\end{document}

enter image description here


You can colourise both cell background and text using the same colour for text and background. If you load the array-package, you can define a new column type G (for green). \arrayrulecolor colourise the lines. Depending of your goals; with this approach you can change each of the three coloured item individually:

\documentclass[border=3.14]{standalone}
\usepackage[table]{xcolor}
\usepackage{array}

\newcolumntype{G}{>{\cellcolor{green}\color{green}}{c}}
\arrayrulecolor{green} % Colourise rule for all tabulars, move inside the tabular environment to limit scope

\begin{document}

\begin{tabular}{| * {2}{G|}}
a & b \\
c & d \\
\end{tabular}
\end{document}

enter image description here