3

I want to show columns of a table dynamically. On the first frame I want to show only the first column without the last row. Then on the second frame only the first column with the last row too. Then the second and third columns with the same pattern. My MWE is given below. I'd highly appreciate it if someone helped me.

\documentclass{beamer}
\usepackage[latin1]{inputenc}
\usetheme{Warsaw}

\usepackage{colortbl}

\begin{document}

\begin{frame}{Introduction}

\begin{tabular}{c<{\onslide<2->}|c<{\onslide<3->}|c<{\onslide<4->}}
\hline 
$X_{i}$ & $X_{i}-\overline{X}$ & $\left(X_{i}-\overline{X}\right)^{2}$\tabularnewline
\hline 
$X_{1}$ & $X_{1}-\overline{X}$ & $\left(X_{1}-\overline{X}\right)^{2}$\tabularnewline
$\vdots$ & $\vdots$ & $\vdots$\tabularnewline
$X_{i}$ & $X_{i}-\overline{X}$ & $\left(X_{i}-\overline{X}\right)^{2}$\tabularnewline
$\vdots$ & $\vdots$ & $\vdots$\tabularnewline
$X_{n}$ & $X_{n}-\overline{X}$ & $\left(X_{n}-\overline{X}\right)^{2}$\tabularnewline
\hline 
$\sum_{i=1}^{n}X_{i}$ & $\sum_{i=1}^{n}\left(X_{i}-\overline{X}\right)=0$ & $\sum_{i=1}^{n}\left(X_{i}-\overline{X}\right)^{2}$\tabularnewline
\hline 
\end{tabular}

\end{frame}

\end{document}

1 Answer 1

5

Something like this?

\documentclass{beamer}
\usepackage{array}
\let\Tiny\tiny
\beamertemplatenavigationsymbolsempty
\begin{document}
\frame{
\begin{tabular}{>{\onslide<1->}c        >{\onslide<3->}c        >{\onslide<5->}c}
A & B & C \\
1 & 2 & 3  \\
3 & 4 & 5  \\
\onslide<2->5 & \onslide<4-> 6 & \onslide<6-> 7
\end{tabular}
}
\end{document}
2
  • 1
    Could you explain the role of > in >{\onslide<1->}? I also saw people using <{\onslide<1->}.
    – semibruin
    Aug 6, 2015 at 20:53
  • 1
    > puts things right before, while < puts it right after. See the documentation for the array package, or the latex wikibook
    – Mark
    Aug 6, 2015 at 22:42

You must log in to answer this question.

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