I'm trying to create a table with NiceTabular, because I had some coloring problems with multicolumn/multirow.
The table looks already good except, that no linebreaks are done in \Block cells. In normal cells the line break works as expected. With multirow I had the same problem, but there I could set again the width as multirow parameter and then linebreak was done, but with NiceTabular I'm not able to do:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{nicematrix} % nicematrix.sty must be installed
\begin{document}
\begin{NiceTabular}[colortbl-like]{|p{1cm}|p{2cm}|Wc{3cm}|p{4cm}|p{4cm}|}
\hline
\Block[fill=[HTML]{FFFF00}]{2-1}{Table Title} &
\Block[fill=[HTML]{FFFF00}]{2-1}{Column 1} & Column & \Block[fill=[HTML]{FFFF00}] {2-2}{Column 3} & \
\cline{3-3}
& & 2 & & \
\hline
Row 1 & Value 1 & Value 2 & Value 3 & Value 4 \
\hline
\Block[fill=[HTML]{780373}]{2-1}{Row 2} &
Long text outside of Block &
\Block[fill=[HTML]{548235}]{2-1}{This cell contains a long value} & \Block[fill=[HTML]{0070C0}]{2-2}{Value 8} & \
\cline{2-2}
& Value 6 & & & \
\hline
\end{NiceTabular}
\end{document}
The table should be create automatically from excel at the end, so adding a linebreak just in the text does not solve the problem. How do I get a linebreak in a NiceTabular \Block?



\Block[fill=[HTML]{548235}]{2-1}{\parbox{3cm}{This cell contains a long value}}? – May 02 '21 at 06:31\Block, you have to put a\parboxin the block (with the right width: maybe this will automated in a further version ofnicematrix). – leandriis May 02 '21 at 08:08