I built this table based on an earlier Q&A:
As you can see there's a problem with the header.
How can I disable the highlighting for headers only?
Here's the code:
\documentclass{article}
\usepackage{booktabs}
\usepackage{colortbl}
\usepackage{xcolor}
\makeatletter
\newcommand*{\yncellcolor}{}
\def\yncellcolor\ignorespaces{\@ifnextchar{1}{\cellcolor{green!20}}{\@ifnextchar{0}{\cellcolor{red!20}}{}}}
\newcolumntype{C}{>{\yncellcolor}c}
\makeatother
\begin{document}
\begin{table}[htp]
\caption{XOR}
\begin{center}
\begin{tabular}{CCCCCCCCCCCCCCCCCC}
\toprule
$Bit$ & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\
\midrule
$A$ & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 \\
$B$ & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\
$\bigoplus$ & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
\bottomrule
\end{tabular}
\end{center}
\label{XOR}
\end{table}
\end{document}


