Tx · LaTeX & TikZ

How to Reveal Multiple Table Rows in Beamer

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose the overlay

    Assign the slide number or range on which the rows should become visible.

  2. 2. Cover each cell

    Wrap every cell in those rows with the same Beamer uncover command.

  3. 3. Keep space reserved

    Use uncover rather than only when later slides should keep the table layout fixed.

  4. 4. Compile and check

    Build the presentation and verify the rows appear on the intended overlays.

Beamer overlays can reveal table content gradually, but a tabular environment needs its column separators and row endings to remain in the right places. A reliable approach is to apply the same overlay command to each cell in every row you want to reveal together.

The example below keeps the table’s layout fixed and reveals two rows on slide 2, then two more on slide 3.

A complete example

\documentclass{beamer}

\begin{document}

\begin{frame}{Rows revealed in groups}
  \centering
  \begin{tabular}{c l}
    \hline
    No. & Item \\
    \hline
    1 & Always visible \\
    \uncover<2->{2} & \uncover<2->{First row in group 1} \\
    \uncover<2->{3} & \uncover<2->{Second row in group 1} \\
    \uncover<3->{4} & \uncover<3->{First row in group 2} \\
    \uncover<3->{5} & \uncover<3->{Second row in group 2} \\
    \hline
  \end{tabular}
\end{frame}

\end{document}

This uses only the beamer document class; no extra package is needed. On the first overlay, the heading and the first data row are visible. On the second, rows 2 and 3 become visible together. On the third, rows 4 and 5 appear as well. The same table remains in place throughout.

Why wrap every cell?

A table row is made of separate cells divided by & and ended by \\. Put \uncover<2->{...} around the contents of each cell, leaving the separators outside the commands. This lets TeX continue to read the table’s alignment structure normally.

The overlay specification determines when the cell content is visible:

  • <2-> means from overlay 2 onward.
  • <3-> means from overlay 3 onward.
  • <2-4> means on overlays 2 through 4, inclusive.
  • <3> means on overlay 3 only.

To make several rows appear together, use the same specification for all of their cells. To reveal rows in sequence, increase the starting overlay number for each row or group. For example, use <2-> for the first group, <3-> for the next, and <4-> for the one after that.

Why use \uncover?

\uncover hides its content on overlays where it is not active without removing the space that content occupies. This normally keeps the table’s width and row positions stable as you advance through the frame.

By contrast, \only<2->{...} removes the content entirely on overlays before 2. Because the hidden cells no longer take up space, the table can change size or shift between overlays. That can be useful when you want the layout to reflow, but it is usually not what you want for a presentation table that should stay still.

\visible<2->{...} also keeps space for hidden content. For this use, it can serve as an alternative to \uncover; \uncover is a common, readable choice.

Common mistakes

Applying the command to just one cell. If a row has several cells, hiding only one cell can leave the others visible. Apply the same overlay specification to each cell in the row if the whole row should appear together.

Putting & inside the command’s argument. Avoid wrapping an entire row in a command with its & separators and \\ inside the argument. Table alignment tokens can interact badly with commands that collect their contents as an argument. Wrapping individual cell contents avoids that risk.

Using \pause inside the table. \pause is convenient in ordinary frame text, but tables are alignment environments, where it can produce awkward results or errors. Explicit overlay specifications make it clear which cells appear on which overlays.

Expecting horizontal rules to be hidden automatically. In the example, \hline is not covered, so the rules are visible from the start. If you need rules to appear with a group of rows, plan their visibility separately; keep the row and column structure valid on every overlay.

Showing a row for only part of a frame

If a row should appear only on overlays 2 and 3, use the same finite range for each cell:

\uncover<2-3>{Temporary value} & \uncover<2-3>{Temporary note} \\

On overlay 4, \uncover hides the contents but still reserves their space. If you want the contents to disappear and the table to reflow, use \only around each cell’s contents with the same overlay range. The row may still occupy some vertical space because tabular inserts row struts, but its dimensions can change and the table may shift. To remove the row entirely, use an approach that conditionally omits the row while keeping the table alignment valid, such as overlay-specific table versions.

References

  1. The beamer class User Guide

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.