# longtable and rowcolors

I tried to use the longtable with the row color and I just simply can get it to work. When I try to do:

\documentclass[10pt, landscape]{report}
%Packages
\usepackage[utf8]{inputenc}
\usepackage[english, ngerman]{babel}
\usepackage{booktabs}
\usepackage{array}
\newcounter{rowno}
\setcounter{rowno}{0}
\usepackage{longtable}
\usepackage[table]{xcolor}
\begin{document}
\rowcolors{1}{gray!40!white}{blue!10!white}
\begin{longtable}{>{\stepcounter{rowno}\therowno.}c c l c l l l l }
\hiderowcolors
\multicolumn{1}{c}{No.} & Article & Word & Type & 3. Person & Präteritum & Perfect & Translation \\
\toprule
\showrowcolors
\hiderowcolors
\multicolumn{1}{c}{No.} & Article & Word & Type & 3. Person & Präteritum & Perfect & Translation \\
\toprule
\showrowcolors
& --- & abdecken & verb & deckt ab & deckte ab & abgedeckt & to cover, \\ \midrule
& --- & abholen & verb & holt ab & holte ab & abgeholte & to collect or pick up \\ \midrule
\end{longtable}
\end{document}


I am getting every row to be the same color - gray. I tried doing different things with it but to no avail.

Did anyone dealt with something like that and have a solution?

-
give a complete example which shows what you see –  Herbert Jan 29 '13 at 18:34
What do want to do with {\stepcounter{rowno}\therowno.}? Please make your given code compilable, so add used packages, document class and \end{document}. –  Kurt Jan 29 '13 at 18:59
The \stepcounter{rowno}\therowno gives an automatic count to the rows in the table (there are ~240 entries in it) –  ulek Jan 29 '13 at 19:06

it is a problem with your setting of \show/hiderowcolors. This works:

\documentclass[10pt, landscape]{report}
%Packages
\usepackage[utf8]{inputenc}
\usepackage[english, ngerman]{babel}
\usepackage{booktabs}
\usepackage{array}
\newcounter{rowno}
\setcounter{rowno}{0}
\usepackage{longtable}
\usepackage[table]{xcolor}
\begin{document}
\rowcolors{3}{gray!40!white}{blue!40!white!80}
\begin{longtable}{>{\stepcounter{rowno}\therowno.}c c l c l l l l }
\multicolumn{1}{c}{No.} & Article & Word & Type & 3. Person & Präteritum & Perfect & Translation \\\toprule
\multicolumn{1}{c}{No.} & Article & Word & Type & 3. Person & Präteritum & Perfect & Translation \\
\toprule
& --- & abdecken & verb & deckt ab & deckte ab & abgedeckt & to cover, \\
& --- & abholen & verb & holt ab & holte ab & abgeholte & to collect or pick up\\             & --- & abholen & verb & holt ab & holte ab & abgeholte & to collect or pick up\\             & --- & abholen & verb & holt ab & holte ab & abgeholte & to collect or pick up\\ \bottomrule
\end{longtable}
\end{document}


-
Actually it appears that \midrule was the problem. When I removed the \show/hidecolors I got nowhere fast, however after removing the \midrule' everything works fine –  ulek Jan 29 '13 at 19:26
Actually it appears that \midrule was the problem. When I removed the \show/hidecolors I got nowhere fast, however after removing the \midrule` everything works fine