,

Colored cells in LaTeX Tables with overlay

If you like to highlight single cells in LaTeX tables in the overlay mode, there is a very simple way to do so: \documentclass[xcolor=table]{beamer} \usepackage{xcolor} \renewcommand<>\cellcolor[1]{\only#2{\beameroriginal\cellcolor{#1}}} \begin{document} \begin{frame} \frametitle{Table Slide} \begin{table}[h] \begin{center} \begin{tabular}{lc} \hline\hline & (1) \\ \hline Treatment dummy & \cellcolor{red}<2>{0.0694*} \\ & (0.0401) \\ Constant & -1.2238*** \\ & (0.0764)  \\ \hline Observations…

If you like to highlight single cells in LaTeX tables in the overlay mode, there is a very simple way to do so:

\documentclass[xcolor=table]{beamer}
\usepackage{xcolor}

\renewcommand<>\cellcolor[1]{\only#2{\beameroriginal\cellcolor{#1}}}

\begin{document}

\begin{frame}
\frametitle{Table Slide}

\begin{table}[h]
\begin{center}
\begin{tabular}{lc}
\hline\hline
 & (1) \\
 \hline
 Treatment dummy & \cellcolor{red}<2>{0.0694*} \\
 & (0.0401) \\
Constant & -1.2238*** \\
 & (0.0764)  \\
\hline
Observations & 1,673  \\
 R-squared & 0.0401 \\
\hline\hline
\end{tabular}
\end{center}
\end{table}

\end{frame}

\end{document}

The “<2>” will tell LaTeX that the cell will only be highlighted in the second layer of the slide, “red” defines the color with which it is highlighted.

Leave a Reply