# Including Large Tables in a beamer Frame

What is the best way of including large tables in a beamer presentation?

-
Welcome to TeX.sx! Could you please be more specific about what you want to achieve. Maybe you can add a example of what you have tried. –  Caramdir Dec 13 '11 at 22:13
Possibly the question tex.stackexchange.com/questions/5067/… is of interest. –  Caramdir Dec 13 '11 at 22:13

If you must include a large table in your presentation, you have a couple of options:

• Construct the table as is necessary and resize it to fit within the actual frame by scaling it down. This is easily obtainable via \resizebox{<width>}{<height>}{<stuff>} from the graphicx package. In order to maintain the correct aspect ratio, specify the one length and make the other !. Here is a visualization:

\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\begin{document}
\begin{frame}
\frametitle{This is a frame with a table}
\begin{tabular}{*{27}{l}}
\toprule
Stuff & A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z \\
\midrule
One   & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Two   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Three & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Four  & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Five  & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Six   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Seven & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
\bottomrule
\end{tabular}
\end{frame}

\begin{frame}
\frametitle{This is a frame with a table}
\resizebox{\linewidth}{!}{% Resize table to fit within \linewidth horizontally
\begin{tabular}{*{27}{l}}
\toprule
Stuff & A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z \\
\midrule
One   & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Two   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Three & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Four  & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Five  & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Six   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Seven & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
\bottomrule
\end{tabular}}
\end{frame}

\end{document}

• You could break your table up into parts by only showing certain columns on certain slides. Another visualization:

\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{array}% http://ctan.org/pkg/array
\newsavebox{\mybox}% Store some content in a box
\newcolumntype{G}{@{}>{\begin{lrbox}{\mybox}}l<{\end{lrbox}}@{}}% a column that Gobbles it's entries
\begin{document}
\begin{frame}
\frametitle{This is a frame with a table}
\begin{tabular}{*{14}{@{\hspace{2pt}}l@{\hspace{2pt}}}*{13}{G}}
\toprule
Stuff & A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z \\
\midrule
One   & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Two   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Three & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Four  & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Five  & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Six   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Seven & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
\bottomrule
\end{tabular}
\end{frame}

\begin{frame}
\frametitle{This is a frame with a table}
\begin{tabular}{@{\hspace{2pt}}l@{\hspace{2pt}}*{13}{G}*{13}{@{\hspace{2pt}}l@{\hspace{2pt}}}}
\toprule
Stuff & A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z \\
\midrule
One   & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Two   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Three & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Four  & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Five  & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Six   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Seven & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
\bottomrule
\end{tabular}
\end{frame}

\end{document}


The advantage with an approach like this is that you code your entire table the way you want to, but selectively show the columns of interest. While row-removal from a table is easy (you either comment them out using %, or delete them outright), column deletion is not that easy.

• Use beamer's zooming capability. From the beamer documentation on 11.3 Adding Anticipated zooming (p 109):

Anticipated zooming is necessary when you have a very complicated graphic that you are not willing to simplify since, indeed, all the complex details merit an explanation. In this case, use the command \framezoom. It allows you to specify that clicking on a certain area of a frame should zoom out this area. You can then explain the details. Clicking on the zoomed out picture will take you back to the original one.

In the above description, "graphic" might just as well have read "object", since it pertains to tables as well.

For the sake of illustration, I've highlighted a couple of entries (in red \alert font) within the same table I've used before, this time also shrunk down using \resizebox and then zoomed in on them using \framezoom.

\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\begin{document}
\begin{frame}
\frametitle{This is a frame with a table}

\framezoom<1><2>[border=1](0pt,11mm)(4.5em,5ex)

\resizebox{\linewidth}{!}{% Resize table to fit within \linewidth horizontally
\begin{tabular}{*{27}{l}}
\toprule
Stuff & A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z \\
\midrule
One   & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
Two   & 26&25&24&23&22&21&20&19&18&17&16&15&14&13&12&11&10&9&8&7&6&5&4&3&2&1 \\
Three & 1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26 \\
\bottomrule
\end{tabular}}
\end{frame}

\end{document}


In the above example, the border was inserted/kept for clarity. However, by default (if you remove the border=<n> option), it will not be displayed. \framezoom has the following syntax:

\framezoom<button overlay spec><zoomed overlay spec>[<options>](<ulx>,uly>)(<zoom width>,<zoom depth>)


As such, I requested a zoom of slide <1>, upon clicking, to be typeset on slide <2>, adding an optional [border=1] of 1pt. The zoomed location on slide <1> is at coordinate (<ulx>,<uly>)=(0pt,11mm) and spans an area of (<width>,<depth>)=(4.5em,5ex).

-
Could anyone please explain the code that splits the table across slides (2nd option). What part of the code leads to the effect? –  Heisenberg Dec 3 '14 at 2:46
@Heisenberg: The column type G puts its contents in a box but never sets it. As such, the column entries (actually, the entire column) is gobbled/removed. You'll note 13 l-columns followed by 13 G-columns in the first table, but 13 G-columns followed by 13 l-columns in the second. So, in the first table, the latter 13 columns are Gobbled, while in the second table, the first 13 columns are Gobbled. –  Werner Dec 3 '14 at 4:01

The best way is not to include a large table in a presentation.

You show a slide for a minute or two. How many numbers could your audience read from it - while trying to listen to your talk? If your table is so large that it cannot fit a beamer page, it is probably too large for showing in a presenation.

You should consider changing formats: use a plot instead of a table to show the trends. An eye can see trends in a picture much better than in long columns of numbers.

-
Your anwser is based on your experiences and does not offers a solution. Slides are typically written to be sefl-contained and informative at the same time, thus the need to include very large table. –  Galois Theory Dec 16 '11 at 20:19