69

I have a LaTeX table that looks like this:

\begin{table}[!ht]
\centering
\small
\caption{
\bf{Caption}}
\begin{tabular}{l|c|c|l|c|c|c|c|c}
field1 & field 2 & ... \\ 
\hline
...

the problem is that even with "\small" the table is too big, since I use:

\usepackage{setspace} 
\doublespacing

in the header. How can I:

  1. Make the table single spaced? and
  2. Make the table smaller?

I'd like it to fit on an entire page.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

6 Answers6

127

http://en.wikibooks.org/wiki/LaTeX/Tables#Resize_tables talks about two ways to do this.

I used:

\scalebox{0.7}{
  \begin{tabular}
    ...
  \end{tabular}
}
maskacovnik
  • 3,080
  • 5
  • 20
  • 26
Krzysztof Voss
  • 1,766
  • 1
  • 13
  • 12
  • 2
    This approach has several serve disadvantages. Amongst others this will result in inhomogeneous fontsizes throughout the document and a suboptimal choice of letter shapes, see https://tex.stackexchange.com/questions/425453/why-not-scale-elements-that-contain-text for more details – samcarter_is_at_topanswers.xyz Jul 01 '19 at 12:26
71

As well as \singlespacing mentioned previously to reduce the height of the table, a useful way to reduce the width of the table is to add \tabcolsep=0.11cm before the \begin{tabular} command and take out all the vertical lines between columns. It's amazing how much space is used up between the columns of text. You could reduce the font size to something smaller than \small but I normally wouldn't use anything smaller than \footnotesize.

Rob Hyndman
  • 30,301
  • 7
  • 73
  • 85
  • This is the answer I was looking for. So many ask you to individually size the columns, when just narrowing the spacing of the whole table is so much easier – Electric Coffee Dec 09 '22 at 09:48
8

if it's too long for one page, use the longtable package. and if it's too wide for the page, use p{width} in place of l,r, or c for the column specifier. you can also go smaller than \small, i.e. \footnotesize and \tiny. I would consult the setspace package for options on how to remove the double space, though it's probably \singlespace or something like that.

Mica
  • 18,501
  • 6
  • 46
  • 43
6

There is also the singlespace environment:

\begin{singlespace}
\end{singlespace}
Penz
  • 5,428
  • 5
  • 31
  • 28
3

You could add \singlespacing near the beginning of your table. See the setspace instructions for more options.

John
  • 6,701
  • 3
  • 34
  • 56
0

If you want a smaller table (e.g. if your table extends beyond the area that can be displayed) you can simply change:

\usepackage[paper=a4paper]{geometry} to \usepackage[paper=a3paper]{geometry}.


Note that this only helps if you don't plan on printing your table out, as it will appear way too small, then.

Jan Sršeň
  • 1,045
  • 3
  • 23
  • 46
Valentin
  • 1
  • 2