[Tex/LaTex] Make less space between lines on a table

line-breakingline-spacingtables

I have a big table where I need to use multiple lines on each cell. The table is too big though so I need the space between lines on each cell to be smaller.

I found on another post that I could use this to make several lines on a cell

\newcommand{\specialcell}[2][c]{\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}

And this is part of my table

\begin {table}[H]
\begin{center}
  \begin{tabular}
      {| >{\footnotesize}C{2cm} | >{\footnotesize}C{2cm} | >{\footnotesize}C{2cm} | >{\footnotesize}C{2cm} | >{\footnotesize}C{2cm} |} \hline Imagen a comparar & $1^{er}$ resultado de clasificación & $2^{do}$ resultado de clasificación & $3^{er}$ resultado de clasificación & $4^{to}$ resultado de clasificación \\
      \hline \specialcell{\includegraphics[scale=0.05]{barley/b2.jpeg} \\ barley2 \\(\textbf{Clase 1})} &
      \specialcell{\includegraphics[scale=0.05]{barley/b2.jpeg} \\barley2 \\(0.0)} &
      \specialcell{\includegraphics[scale=0.05]{barley/b4.jpeg} \\barley4 \\(0.236041)} &
      \specialcell{\includegraphics[scale=0.05]{barley/b5.jpeg} \\barley5 \\(0.248987)} &
      \specialcell{\includegraphics[scale=0.05]{barley/b1.png} \\barley1 \\(0.333787)} \\ 
      \hline \specialcell{\includegraphics[scale=0.05]{canvas/c21.jpeg} \\canvas21 \\\textbf{Clase 2}} &
      \specialcell{\includegraphics[scale=0.05]{canvas/c21.jpeg} \\canvas21 \\(0.0)} & 
      \specialcell{\includegraphics[scale=0.05]{canvas/c28.jpeg} \\canvas28 \\(0.309975)} & 
      \specialcell{\includegraphics[scale=0.05]{seeds/s9.jpeg} \\seeds9 \\(0.321354)} &
      \specialcell{\includegraphics[scale=0.05]{canvas/c14.jpeg} \\canvas14 \\(0.338891)} \\ 
      \hline
  \end{tabular}
  \caption{Resultados de la clasificación ascendente de texturas Outex.} \label{cuadroOutex}
 \end{center}
\end{table}

So any idea how can I make the linebreaks smaller I tried adding [0.5ex] after each linebreak within a cell but the space didn't seem to change.

Best Answer

As David Carlisle pointed out at extrarowheight vs arraystretch, \extrarowheight is a length added by the array package to change the default inter-line gap setting between array or tabular lines. It can be positive or negative (though it appears the negative values are limited in how close they can scrunch the lines).

Here is a demonstration showing both negative and positive \extrarowheight:

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

\begin {table}[ht]
\begin{center}
  \setlength\extrarowheight{-3pt}
  \begin{tabular}{ccc}
  1 & 2 & 3\\
  4 & 5 & 6\\
  7 & 8 & 9\\
  \end{tabular}
  \caption{My caption}
 \end{center}
\end{table}

\begin {table}[ht]
\begin{center}
  \setlength\extrarowheight{6pt}
  \begin{tabular}{ccc}
  1 & 2 & 3\\
  4 & 5 & 6\\
  7 & 8 & 9\\
  \end{tabular}
  \caption{My caption}
 \end{center}
\end{table}

\end{document}

enter image description here