How to draw a simple table with colored cells in Beamer

I am trying to draw a simple "array" data structure in Beamer using tabular. I would like to color some of the cells blue. Here is my M(N)WE.

\documentclass{beamer}

\usepackage[table]{xcolor}
\begin{document}

\begin{frame}
\frametitle{test}

\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\cellcolor{blue!25}A&
\cellcolor{blue!25}B&
\cellcolor{blue!25}C&
B&
A&
B&
C\\
\hline
\end{tabular}
\end{frame}

\end{document}


This doesn't compile. How should it be done?

The first problem is

! LaTeX Error: Option clash for package xcolor.

The "problem" is, that beamer automatically loads the xcolor-package. But luckily you can simply pass your desired option by using \documentclass[xcolor=table]{beamer}

\documentclass[xcolor=table]{beamer}

\begin{document}

\begin{frame}
\frametitle{test}

\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\cellcolor{blue!25}A&
\cellcolor{blue!25}B&
\cellcolor{blue!25}C&
B&
A&
B&
C\\
\hline
\end{tabular}
\end{frame}

\end{document}


• Thanks! I now get only "LaTeX Font Warning: Font shape OT1/cmss/m/n' in size <4> not available (Font) size <5> substituted on input line 18." – felix Jun 5 '14 at 16:36
• Concerning your font size problem: For me, this warning can be ignored, but if you want to get rid of it, have a look at texblog.net/latex-archive/uncategorized/beamer-warnings which basically suggest to include \let\Tiny=\tiny` in the preamble – samcarter_is_at_topanswers.xyz Jun 5 '14 at 16:41