0

Question: Table doesn't appear entirely in the frame of my beamer document. Please guide me

\documentclass[12pt,fleqn]{beamer}
\usepackage{booktabs}
\begin{document}
\begin{frame}
\frametitle{A large table}

\resizebox{\textwidth}{!}{%
    \begin{tabular}{*{5}{c}}
        \toprule
        $x$ & $y$ & $x^2$ & $y^2$ & $xy$ \\
        \midrule
        43 & 29 & 1849 & 841 & 1247 \\
        44 & 31 & 1936 & 961 & 1364 \\
        46 & 19 & 2116 & 361 & 874 \\
        40 & 18 & 1600 & 324 & 720 \\
        44 & 19 & 1936 & 361 & 836 \\
        42 & 27 & 1764 & 729 & 1134 \\
        45 & 27 & 2025 & 729 & 1215 \\
        42 & 29 & 1764 & 841 & 1218 \\
        38 & 41 & 1444 & 1681 & 1558 \\
        40 & 30 & 1600 & 900 & 1200 \\
        42 & 26 & 1764 & 676 & 1092 \\
        57 & 10 & 3249 & 100 & 570\\
        \bottomrule
    \end{tabular}%
}
\end{frame}
\end{document}​

1 Answer 1

1

Never use \resizebox with tables – it leads to inconsistent font sizes, and sometimes unreadable tables.

Use an environment that lets you specify the overall table width, such as tabular* or tabularx. You also can play with the standard font sizes (\small, &c.) and the value of \tabcolsep.

In this case, I propose the following code, using `tabular*:

\documentclass[12pt,fleqn]{beamer}
\usepackage{booktabs}

\begin{document}
\begin{frame}
\frametitle{A large table}

\centering\begin{tabular*}{\framewidth}{@{\extracolsep{\fill}}*{5}{c}}
        \toprule
        $x$ & $y$ & $x^2$ & $y^2$ & $xy$ \\
        \midrule
        43 & 29 & 1849 & 841 & 1247 \\
        44 & 31 & 1936 & 961 & 1364 \\
        46 & 19 & 2116 & 361 & 874 \\
        40 & 18 & 1600 & 324 & 720 \\
        44 & 19 & 1936 & 361 & 836 \\
        42 & 27 & 1764 & 729 & 1134 \\
        45 & 27 & 2025 & 729 & 1215 \\
        42 & 29 & 1764 & 841 & 1218 \\
        38 & 41 & 1444 & 1681 & 1558 \\
        40 & 30 & 1600 & 900 & 1200 \\
        42 & 26 & 1764 & 676 & 1092 \\
        57 & 10 & 3249 & 100 & 570\\
        \bottomrule
    \end{tabular*}
\end{frame}

\end{document}​ 

enter image description here

3
  • Thanks a lot this is what i wanted Once again thank you so much.
    – Math-Man
    Nov 4, 2020 at 10:06
  • How can i add one more raw for showing summation of all columns.
    – Math-Man
    Nov 4, 2020 at 10:08
  • 1
    What do you mean? If it doesn't fit vertically with a supplementary row?
    – Bernard
    Nov 4, 2020 at 10:13

You must log in to answer this question.

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