The new tabularray
makes wrapping text in cells easier then ever before.
The package supports all the traditional used column names like c
, l
, r
, etc., but also has its own Q
column which accepts various keys to control the width and vertical and horizontal alignment. It also provides an X
column, as known from tabularx` which will automatically calculate the width of the column to fit the table into the available text width.
Another nice feature is that all the settings can also be done for individual cells.
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{table}
\begin{tblr}{|c|Q[2cm,valign=m]|X[j,valign=m]|}
\hline
Title 1 & Title 2 & Title 3 \\
\hline
one-liner & multi-line text & multi-line piece of text to show case a multi-line and justified cell \\
\hline
apple & orange & banana \\
\hline
\SetCell{h,2cm} wrapping text only in a single cell & orange & banana \\
\hline
\end{tblr}
\end{table}
\end{document}

(thanks to Shayan Amani for providing a MWE in their answer!)