I want to use the column type described in this answer to hide certain columns in a table. The table occurs multiple times throughout the document, always with different columns hidden. Some of the cells are highlighted using the colortbl package, and this is what appears to cause a problem:

It appears that the colored cells are somehow "leaking" from the hidden cells into the following cells. What can I do to prevent this? I want the background color of the hidden cells disappear completely - I do not want it to appear even partially in the following cells.
MWE:
\documentclass{article}
\usepackage{array}
\usepackage{colortbl}
\newcommand{\gc}{\cellcolor[gray]{.7}}
\newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}}
\newcommand{\tablebody}{%
foo & bar & \gc boo & baz & faa \\
bar & \gc boo & baz & \gc faa & foo \\
\gc boo & baz & faa & foo & \gc bar \\
baz & \gc faa & foo & \gc bar & boo \\
faa & foo & \gc bar & boo & baz %
}
\begin{document}
\section*{all columns visible}
\begin{tabular}{ccccc}
\tablebody
\end{tabular}
\section*{center column hidden}
\begin{tabular}{ccHcc}
\tablebody
\end{tabular}
\section*{middle columns hidden}
\begin{tabular}{cHcHc}
\tablebody
\end{tabular}
\section*{outer columns hidden}
\begin{tabular}{HcccH}
\tablebody
\end{tabular}
\end{document}


\tabcolsepto0pteliminates it, which is a start, but then you need to figure out a way to get the horizontal buffer space back in. – Steven B. Segletes Nov 06 '13 at 19:52