Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to include a table in my presentation (beamer) and this table has 2 panels. I want to first show the first panel and then the second panel, I have been trying to do it unfortunately without any luck. The table is like as shown below (I want to first show the results for $\alpha=0.05$ and then $\alpha=0.5$):

\begin{frame}
\begin{table}
\caption{Table}
\begin{tabular}{l c c c c c c}
\hline \hline
No.  & {Ordinary} & {Blue} & {Pink} & {Yellow} & {Green} & {RCM}\\
\hline
&\multicolumn{6}{c}{$\alpha$=0.05}\\
H=2     &     95.0 &    75.3    &   75.7    &   79.5    &   72.0    &\\
H=3 & 95.6 &    87.0    &   87.3    &   87.6    &   85.2    &\\
H=4 & 95.0 &    91.6    &   91.9    &   90.3    &   90.2    & 93.3\\
H=5 & 95.2 &    93.5    &   93.7    &   91.3    &   91.8    & 94.3\\
H=6 & 94.9 &    93.8    &   94.1    &   92.6    &   92.8    & 94.7\\

&\multicolumn{6}{c}{$\alpha$=0.5}\\

H=2 & 95.0  &   91.4    &   91.2    &   79.5    &   99.9    &   \\
H=3 & 95.6  &   95.1    &   95.1    &   87.6    &   95.1    &   \\
H=4 & 95.0  &   94.8    &   94.8    &   90.3    &   93.5    & 95.5  \\
H=5 & 95.2  &   95.1    &   95.2    &   91.3    &   93.1    & 95.9  \\
H=6 & 94.9  &   94.8    &   94.8    &   92.6    &   93.4    & 95.5  \\
\hline
\end{tabular}
\end{table}
\end{frame}
share|improve this question
1  
Why not enclosing your panel into \onslide? Have a look to the beameruserguide section 9.3 Commands with Overlay Specifications. –  Claudio Fiandrino Nov 21 '12 at 15:18
add comment

1 Answer 1

up vote 11 down vote accepted

Perhaps the simpler solution in this case is to use \only:

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{table}
\caption{Table}
\begin{tabular}{l c c c c c c}
\hline \hline
No.  & {Ordinary} & {Blue} & {Pink} & {Yellow} & {Green} & {RCM}\\
\hline
\only<1>{
&\multicolumn{6}{c}{$\alpha$=0.05}\\
H=2     &     95.0 &    75.3    &   75.7    &   79.5    &   72.0    &\\
H=3 & 95.6 &    87.0    &   87.3    &   87.6    &   85.2    & \\
H=4 & 95.0 &    91.6    &   91.9    &   90.3    &   90.2    & 93.3\\
H=5 & 95.2 &    93.5    &   93.7    &   91.3    &   91.8    & 94.3\\
H=6 & 94.9 &    93.8    &   94.1    &   92.6    &   92.8    & 94.7 \\[-\normalbaselineskip]
}
\only<2>{
&\multicolumn{6}{c}{$\alpha$=0.5}\\
H=2 & 95.0  &   91.4    &   91.2    &   79.5    &   99.9    &   \\
H=3 & 95.6  &   95.1    &   95.1    &   87.6    &   95.1    &   \\
H=4 & 95.0  &   94.8    &   94.8    &   90.3    &   93.5    & 95.5  \\
H=5 & 95.2  &   95.1    &   95.2    &   91.3    &   93.1    & 95.9  \\
H=6 & 94.9  &   94.8    &   94.8    &   92.6    &   93.4    & 95.5 \\[-\normalbaselineskip]
}
\\\hline
\end{tabular}
\end{table}
\end{frame}

\end{document}

enter image description here

Or a simple variation showing each part separately and finally the whole table:

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{table}
\caption{Table}
\begin{tabular}{l c c c c c c}
\hline \hline
No.  & {Ordinary} & {Blue} & {Pink} & {Yellow} & {Green} & {RCM}\\
\hline
\only<1,3>{
&\multicolumn{6}{c}{$\alpha$=0.05}\\
H=2     &     95.0 &    75.3    &   75.7    &   79.5    &   72.0    &\\
H=3 & 95.6 &    87.0    &   87.3    &   87.6    &   85.2    & \\
H=4 & 95.0 &    91.6    &   91.9    &   90.3    &   90.2    & 93.3\\
H=5 & 95.2 &    93.5    &   93.7    &   91.3    &   91.8    & 94.3\\
H=6 & 94.9 &    93.8    &   94.1    &   92.6    &   92.8    & 94.7 \\[-\normalbaselineskip]
}\only<3>{\\}
\only<2,3>{
&\multicolumn{6}{c}{$\alpha$=0.5}\\
H=2 & 95.0  &   91.4    &   91.2    &   79.5    &   99.9    &   \\
H=3 & 95.6  &   95.1    &   95.1    &   87.6    &   95.1    &   \\
H=4 & 95.0  &   94.8    &   94.8    &   90.3    &   93.5    & 95.5  \\
H=5 & 95.2  &   95.1    &   95.2    &   91.3    &   93.1    & 95.9  \\
H=6 & 94.9  &   94.8    &   94.8    &   92.6    &   93.4    & 95.5 \\[-\normalbaselineskip]
}
\\\hline
\end{tabular}
\end{table}
\end{frame}

\end{document}

enter image description here

Another possibility, producing a different kind of overlay, is to use \onslide:

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{table}
\caption{Table}
\begin{tabular}{l c c c c c c}
\hline \hline
No.  & {Ordinary} & {Blue} & {Pink} & {Yellow} & {Green} & {RCM}\\
\hline
\onslide<1->{
&\multicolumn{6}{c}{$\alpha$=0.05}\\
H=2     &     95.0 &    75.3    &   75.7    &   79.5    &   72.0    &\\
H=3 & 95.6 &    87.0    &   87.3    &   87.6    &   85.2    & \\
H=4 & 95.0 &    91.6    &   91.9    &   90.3    &   90.2    & 93.3\\
H=5 & 95.2 &    93.5    &   93.7    &   91.3    &   91.8    & 94.3\\
H=6 & 94.9 &    93.8    &   94.1    &   92.6    &   92.8    & 94.7 \\
}
\onslide<2>{
&\multicolumn{6}{c}{$\alpha$=0.5}\\
H=2 & 95.0  &   91.4    &   91.2    &   79.5    &   99.9    &   \\
H=3 & 95.6  &   95.1    &   95.1    &   87.6    &   95.1    &   \\
H=4 & 95.0  &   94.8    &   94.8    &   90.3    &   93.5    & 95.5  \\
H=5 & 95.2  &   95.1    &   95.2    &   91.3    &   93.1    & 95.9  \\
H=6 & 94.9  &   94.8    &   94.8    &   92.6    &   93.4    & 95.5 \\[-\normalbaselineskip]
}
\\\hline
\end{tabular}
\end{table}
\end{frame}

\end{document}

enter image description here

share|improve this answer
    
Oh fancy! Animated gifs! Amazing how simple technology catches on quickly. (nice answer, too, by the way) –  Loop Space Nov 22 '12 at 7:20
    
Perfect Gonzalo, the last possibility is exactly what I was looking for, Great animation by the way! –  Thembi Nov 22 '12 at 11:21
    
@Gonzalo Medina: I am wondering does the last option work on the beamer as well ? I tried that it is showing on two pages but on both the pages it is showing all the rows of the table. –  Jdbaba Jun 17 '13 at 20:37
    
@Jdbaba I don't understand your question. I am using beamer on all the code of my answer. –  Gonzalo Medina Jun 17 '13 at 20:40
    
@GonzaloMedina I used the part of your code from \begin{frame} to \end{frame} but I am not able to get pause or onslide effect. If I use all the code then I am able to see the effect but if I only copy the section then I am not able to see the effect. Any suggestions please ? BTW is it possible to overlay tables over image ? –  Jdbaba Jun 17 '13 at 20:42
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.