[Tex/LaTex] Color table rows and columns

colortables

I have a table whose rows are set to alternate between white and gray using xcolor's \rowcolors{2}{white}{gray!10}. I also want to highlight a column of that table, sos that it looks something like this:

Alternating rows, highlighted column

I tried using \begin{tabular}{c>{\columncolor{_lblue!25}}cc} to do this, but that just overwrites the color, blending it with white. Is there a way to blend the row and column colors so that it looks like the image? Maybe a variable that holds the background color so I can do something like \columncolor{_lblue!25!\cellbgcolor}?

Edit: What I have right now is

\rowcolors{2}{white}{gray!10}
\begin{tabular}[c>{\columncolor{blue}}cc]
    a & b & c \\
    \hline
    1 & 2 & 3 \\
    4 & 5 & 6 \\
    7 & 8 & 9
\end{tabular}

I've tried to use the transparency package to see I might be able to make the column color transparent in case it was overlaid instead of overwriting, but that makes the whole cell including text transparent. I don't know how I might go about alternating the color on each row while keeping track of the column color.

Best Answer

unfortunately coloring of rows and columns in table doesn't has option for transparency of row colors (as far as i know). so it should be imitated by \cellcolor with appropriate color. for example like this:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[table]{xcolor}
\newcommand\ccg[1]{\cellcolor{gray!30!red!30}{#1}} % for cells in second column 
                                                   % and gray colored rows
\newcommand\ccw[1]{\cellcolor{red!15}{#1}}         % for cells in  second column 
                                                   % white colored rows

\begin{document}
\rowcolors{1}{white}{gray!30}
    \begin{tabular}{c c c}
        a   & \ccw{b}   & c     \\
        \hline
        1   & \ccg{2}   & 3     \\
        4   & \ccw{5}   & 6     \\
        7   & \ccg{8}   & 9     \\
    \end{tabular}
\end{document}

enter image description here

Related Question