# Allow breaking long words in table cell automatically

Is it possible to break long words (note, not lines) in table cell without adding \- or \allowbreak?

Current code is:

\begin{tabularx}{\textwidth}{|p{3.5cm}|p{3.5cm}|X|p{3cm}|p{3cm}|p{4cm}|}
\hline
Name & Name & Name & Name & Name & Name \\
\hline
& & & & & \\
\hline
\end{tabularx}

How to allow long word breaking in, for example, first cell? In case, when word does not have white spaces? Position of line break is not important, let text just fill the cell and break if necessary.

• You can add >{\raggedright}p{3.5cm} so that line breaking in narrow columns is more reasonable, but it will break at white space, not add additional hyphenation points to words – David Carlisle Feb 4 '15 at 10:01
• yeah David, i need a solution to break when there are no white-spaces. I will edit question to bold it. – marxin Feb 4 '15 at 10:05
• You are making TeX do a lot of work to find the width of that middle column using tabularx, you could just use tabular and tell it the answer p{\dimexpr\textwidth-17cm-7\arrayrulewidth-12\tabcolsep} (how big is your paper, that's negative in most classes:-) – David Carlisle Feb 4 '15 at 10:07
• There are answers to show how to break strings at an arbitrary character I'll see if I can spot the duplicate question – David Carlisle Feb 4 '15 at 10:08
• See for example this for breaking at CamelCase, it could be adapted to allow breaking at other, or every, letter tex.stackexchange.com/questions/66593/… – David Carlisle Feb 4 '15 at 10:24