[Tex/LaTex] Reduced word spacing when wrapping text in a cell

spacingtables

I'm wrapping text in a table, some of the cells have 4 words in, wrapped to have two in the first line and two in the second. LaTeX introduces a large space between the first two words so that the second word is at the end of the cell, and the spacing looks looks pretty messy. I can't reduce the cell size without it spreading over too many lines and can't increase the cell size without taking up too much space

\begin{table}
\begin{tabular}{p{1.6cm} p{1.8cm} p{1.8cm} p{1.8cm} p{1.8cm} p{1.8cm}} \hline 
Wavelength (nm) & Rb trap depth ($\mu$K) &  Cs trap depth ($\mu$K) & Heating rate ($\mu$K/s) & Selectivity & Sustainability (s) \\
1&2&3&4&5&6
\end{tabular}
\end{table}

Here Rb and trap and also Cs and trap are so widely spaced they look like they're in the next column and I don't want to use lines to separate the columns.

Any thoughts on how to stop LaTeX spacing out these words?

Best Answer

You probably don't need justified text here, using \raggedright setting avoids stretching the spaces.

Please always post complete documents not just fragments, as below..

enter image description here

\documentclass{article}

\usepackage{array}

\begin{document}

\begin{table}
\setlength\extrarowheight{2pt}
\begin{tabular}{p{1.6cm} *5{>{\raggedright\arraybackslash}p{1.8cm}}} \hline 
Wavelength (nm) & Rb trap depth ($\mu$K) &  Cs trap depth ($\mu$K) &
Heating rate ($\mu$K/s) & Selectivity & Sustainability (s) \\
1&2&3&4&5&6
\end{tabular}
\end{table}
\end{document}