Seems like \rowcolors
when used for a {tabularx}
doesn’t work properly: The specific number of the first row to be colored is ignored. This is not the case for a normal {tabular}
.
In both tables the coloring should start in the third row.
\documentclass{article}
\usepackage{tabularx}
\usepackage[table]{xcolor}
\begin{document}
\begin{minipage}{0.45\textwidth}
\verb|{tabularx}| \\[2ex]
\rowcolors{3}{blue!50}{yellow!60}
\begin{tabularx}{40mm}{X}
1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\
\end{tabularx}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\verb|{tabular}| \\[2ex]
\rowcolors{3}{blue!50}{yellow!60}
\begin{tabular}{p{40mm}}
1 \\ 2 \\ 3 \\ 4 \\ 5 \\ 6 \\
\end{tabular}
\end{minipage}
\end{document}
Is this a bug in xcolor
/tabularx
?
This question is kind of a follow-up question of my answer on Table cell with unwanted black background
tabularx
it is a political act: an Ukrainian flag is added if first two rows. ;-)