Search code examples
latexpresentationbeamer

How can somene create two tables side by side in beamer?


How can somene create two tables side by side in beamer? I use the following to insert one table

\begin{table}
\begin{tabular}{l | c | c | c | c | c}
Model & intercept & X & Y & Adjusted $R^2$ & \\
\hline \hline
Coeff & 2.229 & -0.274 & 1.221 & 38\%\\ 
t-value & 3.404 & -0.49 & 3.907  \\
GMM-t & 2.542 & -0.444 & 3.814\\
\end{tabular}
\end{table}

which command should I use to have two tables side by side like the aforementioned table?


Solution

  • As suggested by this blog, you can try columns environment. For example, with code like

    \begin{frame}{Example}
        \begin{columns}
            \begin{column}{0.3\textwidth}
                \begin{table}
                \begin{tabular}{c|c|c} 
                sid & bid & day \\ \hline \hline 
                22 & 101 & 10/10/96 \\ 
                58 & 103 & 11/12/96 \\ 
                \end{tabular}
                \caption{reserves}
                \end{table}
            \end{column}
            \begin{column}{0.3\textwidth}
                \begin{table}
                \begin{tabular}{c|c|c|c} 
                sid & sname & rating & age \\ \hline \hline 
                22 & dustin & 7 & 45.0 \\ 
                31 & lubber & 8 & 55.5 \\ 
                58 & rusty & 10 & 35.0 \\
                \end{tabular}
                \caption{Sailors}
                \end{table}
            \end{column}
        \end{columns}
     \end{frame}
    

    You can get something like below (ignoring the background image)

    demo