# How to justify the last line in a cell?

MWE:

\documentclass{article}
\begin{document}
\begin{tabular}{|p{2cm}|}
sdlj lsadfj sdlafjk sdlfj a \\
\end{tabular}
\end{document}


The last line is flushed left. I want it to justify.

Similar can be obtained with \linebreak:

sdlj lsadfj sdlafjk sdlfj a \linebreak\\


But it has an obvious side effect: an excessive line. How to justify it without an excessive line? I found a trick for paragraphs, but it doesn't work for cells.

• I'm not able to experiment so this is just a guess. Try wrapping the content of the cell in braces, and using the "trick" as the last thing inside the braces. – barbara beeton Sep 18 '19 at 19:01
• If I replace your \linebreak with \parfillskip 0pt, it works, no braces required. – Steven B. Segletes Sep 18 '19 at 19:03
• This is related to Is there a tool that makes paragraphs into rectangles? (possible duplicate). – Werner Sep 18 '19 at 19:04
• @StevenB.Segletes works this way, thanks. – bodqhrohro Sep 18 '19 at 19:10
• However, it will fail if any line ends up with just a single word, as in \begin{tabular}{|p{2cm}|} succulent cucumbers are delectible\parfillskip 0pt\\ \end{tabular}. It goes back to Ulrike's comment, I am sure. – Steven B. Segletes Sep 18 '19 at 19:15