I wrote a script that generates LaTeX tables from a pandas.DataFrame, hence they may have different numbers of columns. I want to wrap text therein automatically.
Following this advice, I went for
\begin{longtable}{l >{\raggedright}p{0.75\textwidth} }
however this returns and error:
Extra alignment tab has been changed to \cr
Typically, tables look like that:
\begin{longtable}{l >{\raggedright}p{0.75\textwidth}}
\toprule
bla bla & \multicolumn{3}{l}{bla bla} \\
\midrule
\endhead
\midrule
\multicolumn{5}{r}{{Continued on next page}} \\
\midrule
\endfoot
\bottomrule
\endlastfoot
bla bla & & bla bla & & \\
\end{longtable}
>{\raggedright\arraybackslash}
so that\\
retains its meaning of end of table row.