1

I tried replicating this example but when I try to put nodes inside a table like so:

\begin{frame}
    \frametitle{Test}

    \tikzstyle{na} = [baseline=-.5ex]

    \begin{table}[t]
        \label{tab:test}
        \centering
        \setlength{\tabcolsep}{12pt}
        \renewcommand{\arraystretch}{1.1}
        \begin{tabular}{cc}
            Col1 & Col2 \\\hline
            \tikz[baseline]{
                \node (t3)
            {\alert<3>{$2^0$}};} & \alert<3>{0} \\
            $2^{1}$ & 1 \\
            $2^{2}$ & 2 \\
            $2^{3}$ & 3 \\
            $2^{4}$ & 4 \\
            $2^{5}$ & \alert<2>{5} \\
        \end{tabular}
    \end{table}
\end{frame}

The table layout in the second column somehow falls apart. How do I do this properly?

I'm not sure it will work but here is a link for playing around.

1

1 Answer 1

3

Set \tikz[baseline=(t3.base)], so that the t3 node is placed correctly on the baseline of the table row. You may also want to set the inner sep of the node to zero.

\documentclass{beamer}
\usepackage{tikz}

\begin{document}
\begin{frame}
    \frametitle{Test}

    \tikzstyle{na} = [baseline=-.5ex]

    \begin{table}[t]
        \label{tab:test}
        \centering
        \setlength{\tabcolsep}{12pt}
        \renewcommand{\arraystretch}{1.1}
        \begin{tabular}{cc}
            Col1 & Col2 \\\hline
            \tikz[baseline=(t3.base)]{
                \node [inner sep=0pt](t3)
            {\alert<3>{$2^0$}};} & \alert<3>{0} \\
            $2^{1}$ & 1 \\
            $2^{2}$ & 2 \\
            $2^{3}$ & 3 \\
            $2^{4}$ & 4 \\
            $2^{5}$ & \alert<2>{5} \\
        \end{tabular}
    \end{table}
\end{frame}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .