5

I have seen questions about how to add elements to a table in beamer step-by-step, but I am interested in changing existing elements of a table step-by-step. Here is a simple example:

\begin{frame}
\frametitle{Example}
\begin{table}
\centering
\begin{tabular}{c c c}
\toprule
H1 & H2 & H3\\
\midrule
1 & ? & 3 \\
2 & 4 & ?\\
\bottomrule
\end{tabular}
\end{table}
\end{frame}

For example, I would like the ? in the first row after the header to first appear as is, but then when I press the arrow to go to the next slide, it is in a \framebox{}, or has color, something like that.

Is there a way to do this with \onslide{}?

Thanks!

2 Answers 2

2

like this?

\documentclass{beamer}

\usepackage{booktabs}
\usepackage{colortbl}

\begin{document}
\begin{frame}
\frametitle{Example}
\begin{table}
\centering
\begin{tabular}{c c c}
\toprule
H1 & H2 & H3\\
\midrule
1 & \only<2>{\cellcolor{blue!50}}? & 3 \\
2 & 4 & ?\\
\bottomrule
\end{tabular}
\end{table}
\end{frame}
\end{document}

enter image description here

1
3

You can use \only. For example:

1 & \only<1>{?}\only<2>{somethingelse} & 3

The parameter in <> specify when it will be displayed. You can also use ranges:

  • \only<1-3>{abc}: Display abc for the first 3 steps
  • \only<2->{abc}: Display nothing on the first step, then display abc for each following step

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .