[Tex/LaTex] color rows on table (Tabu package)

colortablestabutabularx

I am writing a table with colored rows using the tabupackage (2.10). For example

\documentclass[12pt]{article}
\usepackage{tabu}
\usepackage[table]{xcolor}
\begin{document}
\begin{table}
    \rowcolors{2}{red}{blue}
    \begin{tabu}{cc}
        \toprule
        Row1 & A \\
        Row2 & B \\
        Row3 & C \\
        \bottomrule
    \end{tabu}
\end{table}
\end{document}

I have also tried with \taburowcolors 2{red ... blue} but the colors never show up at all.

I am aware of the issue at the github repo https://github.com/tabu-fixed/tabu/issues and even after manually updating to the 2.10 release, the problem still persists for me.

Does anyone know if the problem has been fixed? If so, how can I get the colored table.

It is worth to mention that I am using the tabuenviroment as I will be using the columns with custom lengths X[n]. Is there any other alternative to tabu where I can set up the length of the columns?

Best Answer

like this?

enter image description here

Why not use tabu package is explained in comments below your question ...

Solution can be use tabularx instead of tabu and boldline for horizontal lines with adjusted thickness (instead booktabs rules, which have (white) space above/below rule):

\documentclass[12pt]{article}
\usepackage{boldline}% for rules, part of Shipunov bundle
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage[table]{xcolor}
\newcounter{tblerows}% see https://tex.stackexchange.com/questions/297345/
                     % why-is-the-start-row-of-rowcolors-ignored-in-tabularx
\expandafter\let\csname c@tblerows\endcsname\rownum

\begin{document}
\begin{table}
    \rowcolors{2}{red!30}{blue!30}
    \begin{tabularx}{0.5\linewidth}{>{\hsize=1.5\hsize}C
                                    >{\hsize=0.5\hsize}C
                                    }
        \hlineB{2}
        Row1 & AA AA \\
        Row2 & B \\
        Row3 & C \\
        \hlineB{2}
    \end{tabularx}
\end{table}
\end{document}