I'm trying to make a table with the following properties:
- If the table is very long, the header should be repeated on each new page.
- Each row should be separated by a line.
- The line immediately after the header row should be black, whereas all the other lines should be gray.
To achieve this, I'm using the longtabu
environment, together with colortbl
to change the color of the lines between the rows. According to the colortbl
documentation, \arrayrulecolor{}
will change the color of any lines after the statement. As such, I figured the following would work as expected:
\documentclass[letterpaper,10pt]{report}
\usepackage[margin=1in]{geometry}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{colortbl}
\definecolor{light-gray}{gray}{0.8}
\begin{document}
\begin{longtabu}{ l l }
\arrayrulecolor{black} % Make the header line black.
Column 1 & Column 2 \\
\hline
\endhead
\arrayrulecolor{light-gray} % Any other lines that come after the header are gray.
Foo & Bar \\
\hline
Foo & Bar \\
\hline
% ... More lines ...
Foo & Bar \\
\hline
Foo & Bar
\end{longtabu}
\end{document}
However, despite the fact that the header is properly repeated, the \arrayrulecolor{black}
line isn't - i.e., only the very first header line is black, while the rest are light-gray
.
I tried Googling, but I can't seem to find a good example of how to do this. How can I achieve the table style I'm looking for?