# Changing the font size in a table

What's the recommend way of changing the font size in a particular table? Is there a better way than enclosing all values with, for example, the \tiny function.

-

Write \tiny immediately after \begin{table}. If you don't use a (floating) table environment, enclose your (e.g.) tabular environment in a group and write \tiny after \begingroup.

\documentclass{article}

\begin{document}

\begin{table}
\tiny
\centering
\begin{tabular}{cc}
Knuth & Lamport
\end{tabular}
\end{table}

\end{document}


EDIT: To change the fontsize for all tables (or even floats of every type), one may use the floatrow package (this also saves typing \centering in every table):

\documentclass{article}

\usepackage{floatrow}
\DeclareFloatFont{tiny}{\tiny}% "scriptsize" is defined by floatrow, "tiny" not
\floatsetup[table]{font=tiny}

\begin{document}

\begin{table}
\begin{tabular}{cc}
Knuth & Lamport
\end{tabular}
\end{table}

\end{document}

-
Just one quick additional remark: whenever your figure/table has a caption, be sure to change the font size only after you've specified the caption. This is particularly important if you're specifying tiny or scriptsize for the font size. –  Mico Aug 31 '11 at 17:26
Anyway to specify font sizes between \tiny and \small? \tiny is too small for me to read and \small is the same as normal font size –  sphere Aug 13 '13 at 0:16
@sphere How about \footnotesize? –  lockstep Aug 13 '13 at 6:53
Dredging up the past... @Mico, I don't see this behaviour at all. None of my captions (specified with \caption) are affected in any way with a fontsize declaration before them inside a table environment. –  a different ben Jan 21 '14 at 23:21

Scale down your table to the textwidth

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\begin{table}
\resizebox{\textwidth}{!}{%
\begin{tabular}{cc}
Knuth & Lamport
\end{tabular}}
\end{table}

\end{document}


then you have the optimal font size. However, existing tabular lines are also scaled down which doesn't matter because it looks nicer.

-
You gave the needed answer, instead of the answer asked for. Great job! –  Marcel Valdez Orozco Feb 9 '13 at 5:51
this works great! thanks! –  ultrajohn May 8 '13 at 12:25
Now if this would only work with text wrapping as well and eliminate the need to manually specify columns widths, that would be awesome. Is there a way to use your functionality and also have automatic text wrapping? –  sphere Aug 9 '13 at 2:57
use a tabularx with X columns –  Herbert Aug 9 '13 at 20:50
superb solution. I like it +1 –  Espanta Feb 28 '14 at 14:11