10

I have a table with borders that I am trying to reveal row by row. However, the borders are rendering badly:

\documentclass{beamer}

\begin{document}
\frame{
\frametitle{Title}

\begin{tabular}{|c|c|}
\hline Row1L & Row1R \\ \hline\pause
Row2L & Row2R \\ \hline
\end{tabular}
}

\end{document}

renders as

bad borders slide 2 is OK

while changing the first row to

\hline Row1L & Row1R \pause \\ \hline

gives me

bad borders version 2

for the first slide instead. Other positions for \pause throw errors. \uncover and \onslide were giving similar problems. Is there any way to get rid of the dangling line from the first example or make something sensible out of the second?

Thanks!

Danny
  • 103

1 Answers1

13

One possibility is to use

\\ \hline\noalign{\pause}

Code:

\documentclass{beamer}

\begin{document}
\frame{
\frametitle{Title}

\begin{tabular}{|c|c|}
\hline Row1L & Row1R \\ \hline\noalign{\pause}
Row2L & Row2R \\ \hline
\end{tabular}
}

\end{document}

enter image description here

  • I thought I understood what the TeX primitive \noalign does but this application has me confused as to how it is working here? – R. Schumacher Feb 25 '15 at 02:08
  • 1
    @R.Schumacher code in \noalign is executed between the rows, in particular after tex has added the right border of row 1 and before it starts row 2 by adding the left border, which is exactly what you need. (+1 to Harish;-) – David Carlisle Feb 25 '15 at 02:12
  • Fantastic, exactly what I needed. Thanks so much! – Danny Feb 25 '15 at 19:07