Tables PDF – How to Create an Enclosing, Fitting PDF for a Table

pdftables

I want to make a document out of a single table, for inclusion into PowerPoint, etc., as a PDF just the size of the table, with a small customizable margin. Which document class should I use, and how do I set the margins?

Best Answer

standalone would be a good choice.

\documentclass[border=1em]{standalone}

\begin{document}
\begin{tabular}{cc}
  a & b \\
  c & d
\end{tabular}
\end{document}

Note that you don't need the \begin{table}\centering or the \end{table} that normally accompanies a table in a standard document. This is because what these commands do is irrelevant for a standalone table. You don't need to put the table in a float, since there's no surrounding text it needs to fit into. You don't need to center it, because there's nothing to center it against. If it's standing alone, it will take up all the space: centering doesn't mean anything in this context...

Related Question