11

I have a tabular environment with three rows, and I would like to show only the first row on my first slide, then show the next row and finally the third row. I have a solution that almost works but it shows borders around rows 2 and 3 when they are not visible, which I don't like. Is there a way to get rid of these empty borders?

Here is my code:

\documentclass{beamer}

\mode<presentation>
{
  \usetheme{default}
  \useinnertheme{rounded}
  \usecolortheme{default}
}

\begin{document}

\begin{frame}{Test Frame}

{\footnotesize
\begin{tabular}{|p{4.0cm}|p{2.9cm}|p{2.950cm}|}
    \hline
    \textbf{Constraint Explanation} & \textbf{Assumptions} & \textbf{Notation} \\ \hline
    Each gate covered by only one module & Suppose gate $g$ is covered by modules $i$, $j$ and $k$ & $Var(g,i) + Var(g,j) + Var(g,k) \leq 1$ \\ \hline
    \onslide<2-> {Selecting a slice in the module implies selecting the common parts of the module & Module $i$ has $n$ slices & forall $1 \leq k \leq n: x_{i_0} - x_{i_k} \geq 0$} \\ \hline
    \onslide<3->{Each sliceable module must select either at least $M$ slices or no slices at all & Module $i$ has $n$ slices & \big( $\sum_{k=1}^n x_{i_k} \big) ~-~ M\cdot x_{i_{0}} \geq 0$} \\ \hline
\end{tabular}
}
\end{frame}

\end{document}

The image I get is the following.

Screenshot showing results of compilation

What I would like exactly the same as the above but without the borders around the second and third rows.

7

enter image description here

\documentclass{beamer}

\mode<presentation>
{
  \usetheme{default}
  \useinnertheme{rounded}
  \usecolortheme{default}
}

\begin{document}
\makeatletter
\let\slideno\beamer@slideinframe
\makeatother


\begin{frame}[t]{Test Frame}
\onslide<2> {}
\onslide<3-> {}
{\footnotesize
\begin{tabular}{|p{4.0cm}|p{2.9cm}|p{2.950cm}|}
    \hline
    \textbf{Constraint Explanation} & \textbf{Assumptions} & \textbf{Notation} \\ \hline
    Each gate covered by only one module & Suppose gate $g$ is covered by modules $i$, $j$ and $k$ & $Var(g,i) + Var(g,j) + Var(g,k) \leq 1$ \\ \hline
\ifnum\slideno>1 
    Selecting a slice in the module implies selecting the common parts of the module & Module $i$ has $n$ slices & forall $1 \leq k \leq n: x_{i_0} - x_{i_k} \geq 0$\\ \hline
    \ifnum\slideno>2 
    Each sliceable module must select either at least $M$ slices or no slices at all & Module $i$ has $n$ slices & \big( $\sum_{k=1}^n x_{i_k} \big) ~-~ M\cdot x_{i_{0}} \geq 0$\\ \hline
\fi\fi
\end{tabular}
}
\end{frame}

\end{document}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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