How can I make tabularx break lines rather than hypenate?

by Martin Thoma   Last Updated September 21, 2017 12:23 PM

I tables, especially in the header row, I prefer line breaks rather than hyphenating words.

Can I make LaTeX prefer line breaks to hyphenation?

Minimal Example

\documentclass[a5paper]{article}
\usepackage[pass]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero
eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet.

\begin{tabularx}{\textwidth}{|X|X|X|}
\hline
abcefghijkl bananarama & abcefghijkl bananarama & abcefghijkl bananarama \\\hline
\end{tabularx}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero
eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{document}

gives

enter image description here

but I would rather like "bananarama" to be one word on a new line



Related Questions


Updated August 18, 2017 17:23 PM

Updated July 12, 2019 02:23 AM

Updated April 23, 2017 19:23 PM

Updated April 16, 2018 11:23 AM