I found out from this question that one can make a longtable zebra striped by using
\rowcolors{2}{white}{gray!25}
So I tried it but noticed that it doesn't look good in my project - the stripe sticks out of the table and has some holes in it:

After trying out a few things I noticed the @{\extracolsep{\fill}} is the problem.
Without it the color is perfect:

But my table is not wide enough then.
Is there a better alternative for @{\extracolsep{\fill}} or for \rowcolors{2}{white}{gray!25} to make both things work together (while staying with longtable)?
Here's the full minimal example (I build it with XeLaTeX btw., haven't tried if it works with PdfLaTeX):
\documentclass[a4paper, 11pt]{article}
\usepackage{fontspec}
\usepackage{longtable}
\usepackage[table]{xcolor}
\begin{document}
\rowcolors{2}{white}{gray!25}
\begin{longtable}{@{\extracolsep{\fill}}clr}
% \begin{longtable}{clr}
\hline
\noalign{\smallskip}
{Test Col1\hfill} &
{Test Col2\hfill} &
{Test Col3}\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
\endhead
\noalign{\smallskip}
\hline
\endfoot
\endlastfoot
Test & Test & Test \
Test & Test & Test \
Test & Test & Test \
Test & Test & Test \
\end{longtable}
\end{document}



longtablein my original project - when I tried everything somehow ended up in one column. So I'm still hoping maybe someone knows how to solve this problem usinglongtable– Cold_Class Apr 16 '22 at 12:54