What is the best way to make the red text fit the width of the merged cells/rows and automatically break the line instead of causing overflow to the next cell and cells content ?

PS: I never used package tabularx.

enter image description here


\multirow{2}*{\textcolor{red}{this is a long text long}} & \multirow{2}*{here is a text} & \multirow{2}*{\textcolor{red}{this is a long text long}} & \multicolumn{2}{c|}{text}\\
  &   &   & \textcolor{green}{it works here text} & here is a text\\
\multirow{3}*{text} & \multirow{3}*{\textcolor{red}{this is a long text long long}} &  \textcolor{green}{split like this long text } & \multirow{3}*{text} & \multirow{3}*{text}\\

  &   &   text & \\
  &   &   text & \\

The code follows: How do i get a table with this layout?

  • 1
    you need to specify a width not * for multirow so it uses p column formatting Feb 29, 2016 at 11:28

1 Answer 1


As David Carlisle said in his comment, instead * you need to declare width of column, for example for multirow in the first column:

\multirow{2}{2.5cm}{this is a long text long}

With this corection you will obtain:

enter image description here

The last vertical line is missed because you has in the last two rows only 3 ampersands instead four. By the way, LaTeX use decimal point, not comma.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.