# [Tex/LaTex] Use xcolor for colored tables in a beamer slide

beamercolorlyx

How can I use a table with alternately colored rows like this in a beamer slide? There seems to be a conflict with beamer and xcolor. I am using LyX too, bonus marks for something that works well in LyX.

\documentclass{article}
\usepackage[table]{xcolor}
\begin{document}
\begin{center}
\rowcolors[]{2}{blue!20}{blue!10}
\begin{tabular}{ r p{4cm} l}\hline
\textbf{col1} &\textbf{col2} &\textbf{col3}\\\hline
& & \\
& & \\
& & \\
& & \\
& & \\
& & \\
\end{tabular}

\end{center}

\end{document}


It's easy:

\documentclass[xcolor=table]{beamer}


or

\documentclass[table]{beamer}


You can also use:

\PassOptionsToPackage{table}{xcolor}
\documentclass{beamer}