[Tex/LaTex] How to prevent hyphenation in a table column

hyphenationline-breakingtables

I have a table (tabular) with some fixed width columns, and I'd like to prevent a hyphen being inserted (preferring a line break to be inserted prematurely).

The sample table's content is below.

\begin{tabular}{p{4cm}p{4cm}}
Want to avoid hyphenation & also want to avoid hyphenation here \\
\end{tabular}

How can I do this? I'd also like to tell latex not to allow each column to exceed its specified width (so I don't want a solution that means assigning hyphenation the same badness rating as an overfull hbox).

Best Answer

Setting the text ragged right will do this for you. Something like

\usepackage{array}
...
\begin{tabular}{>{\raggedright}p{4cm}>{\raggedright\arraybackslash}p{4cm}}
Want to avoid hyphenation & also want to avoid hyphenation here \\
\end{tabular}
Related Question