\RequirePackage{filecontents}
\begin{filecontents*}{data.csv}
colname
first
second
\end{filecontents*}

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{datatool}

\DTLloaddb{sample}{data.csv}

\begin{document}

\begin{tabular}{c}
\rowcolor{orange}%
\DTLforeach*{sample}{\word=colname}{%
  \word
  \DTLiflastrow{\rowcolor{green}}{%
    \DTLifoddrow{\rowcolor{gray!20}}%
                {\rowcolor{orange}}%
  }%
}
After rows from the CSV file
\end{tabular}

\end{document}
