0

In the simplified code shown below, I am trying to get alternate colors in the table from the code used by Harvey Sheppard. My output table does not contain any colors. Is there some configuration that I have to make to my Windows PC to get the colors to show? Any help is appreciated!

CODE

\documentclass{article}


\usepackage{lipsum}
\usepackage{calc}
\usepackage[table]{xcolor}
\usepackage[
    left=3cm,
    right=3cm,
    top=3cm,
    bottom=3cm,
]{geometry}
\RequirePackage{makecell}
\RequirePackage{tabu}
\RequirePackage{longtable}
\RequirePackage[table]{xcolor}


\providecolor{mainColor}{RGB}{211, 47, 47}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       Default Table Configuration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Row will alternate color
\definecolor{tableLineOne}{RGB}{245, 245, 245}
\definecolor{tableLineTwo}{RGB}{224, 224, 224}
\taburowcolors[2] 2{tableLineOne .. tableLineTwo}

% Add a thin white line between all lines
\AtBeginDocument{\everyrow{\tabucline[.4mm  white]{}}}

% Redefine line sep to make the table more spaced
\tabulinesep = ^2.5mm_2mm

% Provide a command to style the headers of the tables
\newcommand{\tableHeaderStyle}{
    \rowfont{\bfseries\leavevmode\color{white}}
    \rowcolor{mainColor}
    \Gape[3.5mm][1.5mm]{}
}


\title{yFlatTable Example}
\author{Harvey Sheppard}



\begin{document}

    \maketitle

    \begin{tabu}{ l l l }
        \tableHeaderStyle
        Class & Grade & Professor\\
        French & 10 & Pr. Bonvin\\
        Math & 12 & Pr. Squarero-Ots\\
        English & 8 & Pr. Shakespeare\\
    \end{tabu}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.