GeneralColoring columns of a table in Beamer

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
bernardo
Posts: 2
Joined: Fri Sep 12, 2008 4:11 pm

Coloring columns of a table in Beamer

Post by bernardo »

I can uncover a table columnwise in Beamer using \onslide but cannot add colors to the columns using the example below from the Beamer user guide.

Example:
---------------
\columncolors[]{1}{blue!20}{blue!10}
\begin{tabular}{l!{\vrule}c<{\onslide<2->}c<{\onslide<3->}c<{\onslide<4->}c<{\onslide}c}
Class & A & B & C & D \\
X & 1 & 2 & 3 & 4 \\
Y & 3 & 4 & 5 & 6 \\
Z & 5 & 6 & 7 & 8
\end{tabular}
----------------

You can see the problem running the whole code below:

----------------------------------
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{fancyvrb,color}
\usepackage{colortbl}
\usetheme{Madrid}

\title{Hello}
\author{Me}
\begin{document}
\frame {
\frametitle{Problem?}
\columncolors[]{1}{blue!20}{blue!10}
\begin{tabular}{l!{\vrule}c<{\onslide<2->}c<{\onslide<3->}c<{\onslide<4->}c<{\onslide}c}
Class & A & B & C & D \\
X & 1 & 2 & 3 & 4 \\
Y & 3 & 4 & 5 & 6 \\
Z & 5 & 6 & 7 & 8
\end{tabular}
}
\end{document}
-----------------------

Any advice would be much appreciate it.

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

bernardo
Posts: 2
Joined: Fri Sep 12, 2008 4:11 pm

Re: Coloring columns of a table in Beamer

Post by bernardo »

:roll: :roll: :roll:

It was a silly mistake, I need to add the option:

\documentclass[.....,xcolor=table]{beamer}

at the preamble!

:D :D
Post Reply