How do I reduce the size of an entire LaTeX table?

165,455

Solution 1

Use \resizebox:

\resizebox{3cm}{!}{
  \begin{something}
    something
  \end{something}
  }

The ! tells LaTeX to keep the aspect ratio. You can also scale the y direction differently by giving a value there.

Solution 2

Scaling elements that contain text is really not a good idea (see https://tex.stackexchange.com/questions/425453/why-not-scale-elements-that-contain-text for more information) therefore here are two other approaches how to reduce the size of a table:

  • reducing the inter column space with \addtolength{\tabcolsep}{-1pt}
  • manually selecting a smaller font size, e.g. with font commands like \small or for more fine control \fontsize{9.5pt}{10.25pt}\selectfont

\documentclass{article}

\usepackage{lipsum}

\begin{document}

Reducing the inter column spacing a bit:
\begin{table}[htbp]
\addtolength{\tabcolsep}{-1pt}
\begin{tabular}{lll}
\hline
some text some text & some text some text & some text some text some text\\
\hline
\end{tabular}
\end{table}

\lipsum[2]

Smaller font size:
\begin{table}[htbp]
\small
\begin{tabular}{lll}
\hline
some text some som text & some text some text & some text some text some text\\
\hline
\end{tabular}
\end{table}


\end{document}
Share:
165,455

Related videos on Youtube

euphoria83
Author by

euphoria83

Love computers, technology and Apple. Wanna be entrepreneur.

Updated on July 09, 2022

Comments

  • euphoria83
    euphoria83 almost 2 years

    I have a table that I want to appear a little smaller to save some space. What environment can I put it in to shrink the whole table by a fraction ?

    • Brooks Moses
      Brooks Moses over 13 years
      This is off-topic on stackoverflow; LaTeX questions should go on tex.stackexchange.com.
    • euphoria83
      euphoria83 over 13 years
      @Brooks. Not sure. Why is SO not porting all the tex questions to tex.SE ?
    • Brooks Moses
      Brooks Moses over 13 years
      See meta.stackexchange.com/questions/70466/…. My take is that there's no auto-port for all TeX questions because a few of them are programming, but that most of them really belong on the TeX.stackexchange site.
  • Joey
    Joey about 5 years
    Welcome to Stack Overflow. Please improve your answer by adding at least a few words to help explain it.
  • samcarter_is_at_topanswers.xyz
    samcarter_is_at_topanswers.xyz about 5 years
    Please have a look at tex.stackexchange.com/questions/425453/… Scaling fonts is really not a good idea
  • samcarter_is_at_topanswers.xyz
    samcarter_is_at_topanswers.xyz about 5 years
    Te syntax is a bit off. \fotnotesize is a switch which does not take an argument. Therefore it should be \footnotesize ... instead of \footnotesize{...}
  • Juanith
    Juanith about 5 years
    This is an example: \begin{table}[h!] \resizebox{6cm}{!} { \begin{tabular}{l} \hline \multicolumn{1}{c}{\textbf{Clase}} \\ \hline Contenido adiposo (Grasa) \\ \end{tabular} } %\caption{Versiones a comparar.} \end{table}
  • Juanith
    Juanith about 5 years
    I mean about resize the size in a table in latex. I use this code for example in Beamer and it's success
  • Juanith
    Juanith about 5 years
    Sorry for the code unindented but, I haven't understood how to put very well my answers in stack overflow in order to put latex code. But the code that I write in my comments is true. I used it in my presentation on latex.
  • Juanith
    Juanith about 5 years
    \resizebox is the command to add between tabular tag in order to resize the table. It have three parameters \resize{}{}{} in the example I wrote \resize{6cm}{!}{ <<table content>>} in this case 6cm is six centimeter the size of the table content, you can change this number.
  • Juanith
    Juanith about 5 years
    If you need information about how to create tables on latex automatically please use the web site tablesgenerator.com and resize the table using \resizebox command put it between \beging{table} and \beging{tabular}. For example: \beging{table} \resizebox{6cm}{!}{ \beging{tabular} <<content table>> \end{table} }%close the resize box \end{tabular}