3

This is my MWE:

\documentclass[pdf]{beamer}
\begin{document}
\begin{frame}
\begin{table}[ht]
\caption{GLIFT Label Propagation Rules for AND gate}
\centering
\begin{tabular}{c | c c c c}
\hline\hline
AND & (Trusted, 0) & (Trusted, 1) & (Untrusted, 0) & (Untrusted, 1) \\
\hline
(Trusted, 0) & Trusted & Trusted & Trusted & Trusted \\
(Trusted, 1) & Trusted & Trusted & Untrusted & Untrusted \\
(Untrusted, 0) & Trusted & Untrusted & Untrusted & Untrusted \\
(Untrusted, 1) & Trusted & Untrusted & Untrusted & Untrusted \\
\hline
\end{tabular}
\label{table:AND}
\end{table}
\end{frame}
\end{document}

The problem is the table doesn't fit in a frame. enter image description here

kamalbanga
  • 1,211
  • 2
  • 12
  • 17
  • Related: http://tex.stackexchange.com/questions/77998/fitting-tables-into-beamer?rq=1 –  Apr 29 '14 at 10:43
  • Don't resize: the type in the table should have the same size as the running text. Reformulate: \documentclass[pdf]{beamer}\usepackage{booktabs}\begin{document}\begin{frame}\begin{table}[ht]\caption{GLIFT Label Propagation Rules for AND gate}\centering\begin{tabular}{*5c}\toprule\multicolumn{1}{r}{AND}&$(T,0)$&$(T,1)$&$(U,0)$&$(U,1)$\\midrule$(T,0)$&$T$&$T$&$T$&$T$\$(T,1)$&$T$&$T$&$U$&$U$\$(U,0)$&$T$&$U$&$U$&$U$\$(U,1)$&$T$&$U$&$U$&$U$\\midrule\multicolumn{5}{r}{$T$ means trusted; $U$ means untrusted}\\bottomrule\end{tabular}\label{table:AND}\end{table}\end{frame}\end{document} –  Apr 29 '14 at 11:30

1 Answers1

5

Scale it down with \resizebox

\documentclass{beamer}
\usepackage{caption}
\begin{document}
\begin{frame}

\captionof{table}{GLIFT Label Propagation Rules for AND gate}\label{table:AND}
\resizebox{\linewidth}{!}{%
\begin{tabular}{@{} c | c c c c @{}}\hline\hline
AND & (Trusted, 0) & (Trusted, 1) & (Untrusted, 0) & (Untrusted, 1) \\
\hline
(Trusted, 0) & Trusted & Trusted & Trusted & Trusted \\
(Trusted, 1) & Trusted & Trusted & Untrusted & Untrusted \\
(Untrusted, 0) & Trusted & Untrusted & Untrusted & Untrusted \\
(Untrusted, 1) & Trusted & Untrusted & Untrusted & Untrusted \\
\hline
\end{tabular}}
\end{frame}

\end{document}

enter image description here