# A problem with a table im my beamer documentclass

Can the table in the screenshot below be shifted a little to the left ?

Here is my code concerning the slide containing this table

\begin{frame}
%\begin{table}[ht]
%\caption{}
\begin{tabular}{|l|c|c|c|c|c|c|c|}    \hline
Algebras                                    &{\sf At-can.}&{\sf At. gen}& {\sf El. gen}.                        & {\sf Can.}  & {\sf Str} is el. &{\sf CR} is el.& $\sf VT$\\

\hline
${\sf RCA}_n$, $\sf RRA$ &no&yes&yes&yes&no&no&no\\

\hline
$\bold S{\sf Nr}_n\CA_{n+1}$   &yes&yes&yes&yes&yes&?& ?\\

\hline
$\bold S\Ra\CA_3, \bold S\Ra\CA_4$  &yes&yes&yes&yes&yes&yes& yes\\

\hline
$\bold S{\sf Nr}_n\CA_{n+2}$ &?&yes&yes&yes&?&?&?\\

\hline
$\bold S\Ra\CA_5$ &?&yes&yes&yes&?&yes&yes\\

\hline
$\bold S{\sf Nr}_n\CA_{n+k}$, $\bold S\Ra\CA_m$  &no&yes&yes&yes&?&no&no\\

%\hline
%$\bold S{\sf Nr}_n{\sf D}_{n+k}$  &no&no&yes&?\\

\hline
${\sf D}_n, {\sf G}_n$  &yes&yes&yes&yes&yes&yes&yes\\

\hline

\end{tabular}
\end{frame}


As mentioned in the title, I use beamer documentclass.

I appreciate any help.

• \hspace*{-1cm}\begin{tabular}... ? Jul 19 '17 at 19:05
• The last column does not appear in my slide. It it possible to decrease the width of each column a little? I think this will solve the problem. @DavidCarlisle Jul 19 '17 at 19:09
• Yes I do @Mico . Jul 19 '17 at 19:14
• put \small before the table? really you have been on the site long enough to know that you should provide a proper example that allows answers to be tested. Jul 19 '17 at 19:22
• make a proper example then answers can be tested! (but \small needs to be inside the table before tabular, not before \begin{table}) Jul 19 '17 at 19:26

## 1 Answer

Some suggestions:

• Reduce the value of \tabcolsep, the parameter that governs the amount of intercolumn whitespace, and switch the relative font size to \small.

• Get rid of all vertical rules and most horizontal rules. Use the macros of the booktabs package instead of \hline.

• Increase the value of \arraystretch to create a more "open" look.

• Don't use the Plain-TeX command \sf. Instead, use either \textsf or \mathsf, as appropriate.

\documentclass{beamer}
\newcommand\CA{CA} %??
\newcommand\Ra{Ra} %??
\usepackage{booktabs}
\begin{document}

\begin{frame}
\renewcommand\arraystretch{1.33}
\setlength\tabcolsep{1.75pt} % default is 6pt
\small
\begin{tabular}{@{}l *{7}{c}@{}}
\toprule
Algebras  &At-can.& At.\ gen & El.\ gen. & Can. & Str is el. & CR is el. & $\mathsf{VT}$\\
\midrule
$\mathsf{RCA}_n$, $\mathsf{RRA}$          &no&yes&yes&yes&no&no&no\\
$\mathbf{S}\mathsf{Nr}_n\CA_{n+1}$        &yes&yes&yes&yes&yes&?& ?\\
$\mathbf{S}\Ra\CA_3, \mathbf{S}\Ra\CA_4$  &yes&yes&yes&yes&yes&yes& yes\\
$\mathbf{S}\mathsf{Nr}_n\CA_{n+2}$        &?&yes&yes&yes&?&?&?\\
$\mathbf{S}\Ra\CA_5$                      &?&yes&yes&yes&?&yes&yes\\
$\mathbf{S}\mathsf{Nr}_n\CA_{n+k}$, $\mathbf{S}\Ra\CA_m$  &no&yes&yes&yes&?&no&no\\
%$\mathbf{S}\mathsf{Nr}_n\mathsf{D}_{n+k}$  &no&no&yes&?\\
$\mathsf{D}_n, \mathsf{G}_n$              &yes&yes&yes&yes&yes&yes&yes\\
\bottomrule
\end{tabular}
\end{frame}
\end{document}


Addendum: If the intercolumn whitespace in the preceding solution isn't quite wide enough for your taste, you'll need to reduce the font size a bit more, viz., go from \small to \footnotesize. Then, use a \tabular* environment instead of a tabular environment, and let LaTeX figure out the optimal (i.e., maximally permissible) amount of intercolumn whitespace.

\documentclass{beamer}
\newcommand\CA{\mathsf{CA}} %?
\newcommand\Ra{\mathsf{Ra}} %?
\usepackage{booktabs}
\begin{document}

\begin{frame}
\renewcommand\arraystretch{1.33}
\setlength\tabcolsep{0pt} % make LaTeX figure out optimal amount of whitespace
\footnotesize
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l *{7}{c}}
\toprule
Algebras  &At-can.& At.\ gen & El.\ gen. & Can. & Str is el. & CR is el. & $\mathsf{VT}$\\
\midrule
$\mathsf{RCA}_n$, $\mathsf{RRA}$          &no&yes&yes&yes&no&no&no\\
$\mathbf{S}\mathsf{Nr}_n\CA_{n+1}$        &yes&yes&yes&yes&yes&?& ?\\
$\mathbf{S}\Ra\CA_3$, $\mathbf{S}\Ra\CA_4$&yes&yes&yes&yes&yes&yes& yes\\
$\mathbf{S}\mathsf{Nr}_n\CA_{n+2}$        &?&yes&yes&yes&?&?&?\\
$\mathbf{S}\Ra\CA_5$                      &?&yes&yes&yes&?&yes&yes\\
$\mathbf{S}\mathsf{Nr}_n\CA_{n+k}$, $\mathbf{S}\Ra\CA_m$ &no&yes&yes&yes&?&no&no\\
%$\mathbf{S}\mathsf{Nr}_n\mathsf{D}_{n+k}$ &no&no&yes&?\\
$\mathsf{D}_n$, $\mathsf{G}_n$            &yes&yes&yes&yes&yes&yes&yes\\
\bottomrule
\end{tabular*}
\end{frame}
\end{document}

• This is very good. I need something more. How can I put a separation between each column, as done in my example? . Jul 19 '17 at 19:37
• @HusseinEid - The table doesn't need the vertical bars -- unless you're fond of the "prison cell window" look...
– Mico
Jul 19 '17 at 19:46
• @HusseinEid - I've provided a second solution, which uses \footnotesize instead of \small as the (relative) font size. That way, it's possible to increase the amount of intercolumn whitespace a bit. (I still wouldn't use vertical bars, though...)
– Mico
Jul 19 '17 at 20:04