tabularx e multirow: comportamento estranho

tabularx e multirow: comportamento estranho

MWE

\documentclass[12pt]{article}

\usepackage[
    a4paper,
    left = 5mm,
    right = 5mm,
    landscape,
    %showframe,
    ]
    {geometry}

\usepackage{tabularx}
\usepackage{multirow}

% Thicker table lines for screenshot
\setlength{\arrayrulewidth}{1.5pt}
\setlength{\parindent}{0pt}

\usepackage[table]{xcolor}
\definecolor{myTableColor}{gray}{0.80}

% Nice sf font for screenshot
\usepackage[sfdefault]{cabin}

% https://tex.stackexchange.com/questions/163061
% https://tex.stackexchange.com/questions/89166
\newcolumntype{Y}{>{\centering\arraybackslash}X} 

\begin{document}

\section*{Red Text Causes Strange Column}

\begin{tabularx}{\textwidth}{lc|l|Y|Y|Y|Y}
& & & \multicolumn{3}{c}{\multirow{2}{*}{\parbox{130mm}{\centering Text}}} & \\ 
% New Row
& & & \multicolumn{3}{l}{} & \\ 
% New Row
Text & Text & & & & & \\ \hline
% New Row
\rowcolor{myTableColor}
Text & Text & & & & \textcolor{red}{Problem Column} & \\ \hline
% New Row
Text Text Text Text \textcolor{red}{Text} & Text & Text Text Text Text Text \textcolor{red}{Text} & & & & \\ \hline
% New Row
Text & Text & & & & & \\ \hline
\end{tabularx}

\section*{Red Text Removed}

\begin{tabularx}{\textwidth}{lc|l|Y|Y|Y|Y}
& & & \multicolumn{3}{c}{\multirow{2}{*}{\parbox{130mm}{\centering Text}}} & \\ 
% New Row
& & & \multicolumn{3}{l}{} & \\ 
% New Row
Text & Text & & & & & \\ \hline
% New Row
\rowcolor{myTableColor}
Text & Text & & & & \textcolor{blue}{No Problem Column} & \\ \hline
% New Row
Text Text Text Text & Text & Text Text Text Text Text & & & & \\ \hline
% New Row
Text & Text & & & & & \\ \hline
\end{tabularx}

\end{document}

Saída MWE

insira a descrição da imagem aqui

Problema

  • Eu tenho uma tabela na qual uso tabularxe multirow.
  • Quando adiciono o texto vermelho no MWE, obtenho uma mudança em uma das Xcolunas.
  • Eu não entendo o que acontece.

Atualizar

Depois do bate-papo nos comentários, acho que essa pode ser a melhor pergunta:

Posso usar um multirowe multicolumncom quebra de linha automática sem precisar especificar explicitamente a largura (aqui 120 mm)?

Mesa "real"

Esta é a mesa "real".

insira a descrição da imagem aqui

Responder1

Você deseja usar uma coluna Y para sua entrada abrangente

insira a descrição da imagem aqui

\documentclass[12pt]{article}

\usepackage[
    a4paper,
    left = 5mm,
    right = 5mm,
    landscape,
    %showframe,
    ]
    {geometry}


\usepackage{tabularx}
\usepackage{multirow}

% Thicker table lines for screenshot
\setlength{\arrayrulewidth}{1.5pt}
\setlength{\parindent}{0pt}

\usepackage[table]{xcolor}
\definecolor{myTableColor}{gray}{0.80}

% Nice sf font for screenshot
\usepackage[sfdefault]{cabin}

% https://tex.stackexchange.com/questions/163061
% https://tex.stackexchange.com/questions/89166
\newcolumntype{Y}{>{\centering\arraybackslash}X} 

\begin{document}

\section*{Red Text Causes Strange Column}

\begin{tabularx}{\textwidth}{lc|l|Y|Y|Y|Y}
& & & 
\multicolumn{3}{>{\hsize=\dimexpr3\hsize+4\tabcolsep+2\arrayrulewidth\relax}Y}
{\multirow{2}{=}{\centering Text 
text text text text text text text text text text
text text text text text text text text text text
text text text text text text text text text text
}} & \\ 
% New Row
& & & \multicolumn{3}{l}{} & \\ 
% New Row
Text & Text & & & & & \\ \hline
% New Row
\rowcolor{myTableColor}
Text & Text & & & & \textcolor{red}{Problem Column} & \\ \hline
% New Row
Text Text Text Text \textcolor{red}{Text} & Text & Text Text Text Text Text \textcolor{red}{Text} & & & & \\ \hline
% New Row
Text & Text & & & & & \\ \hline
\end{tabularx}

\section*{Red Text Removed}

\begin{tabularx}{\textwidth}{lc|l|Y|Y|Y|Y}
& & & \multicolumn{3}{c}{\multirow{2}{*}{\parbox{130mm}{\centering Text}}} & \\ 
% New Row
& & & \multicolumn{3}{l}{} & \\ 
% New Row
Text & Text & & & & & \\ \hline
% New Row
\rowcolor{myTableColor}
Text & Text & & & & \textcolor{blue}{No Problem Column} & \\ \hline
% New Row
Text Text Text Text & Text & Text Text Text Text Text & & & & \\ \hline
% New Row
Text & Text & & & & & \\ \hline
\end{tabularx}

\end{document}

informação relacionada