Regarding the MWE shown below, I do not know the reason for non-uniform row color among merged columns and rows. Although I am using the command (\rowcolor{gray!25}), rows are partially colored in the region of merged columns and merged rows. I noticed that
it is mainly the second cell in a multi-column + multi-row command that does not go along with the \rowcolor command. It causes the formatting to be inappropriate in a noticable manner.
Also this issue apears usually (but not all the time) when using multi-row and multi-column commands at the same time,If any of those commands is used alone/seperately, row colors have no issues, but upon using them on the same group of cells, such issue arise. i.e:
\multicolumn{1}{|>{\centering\arraybackslash}m{8cm}|}
{\multirow[c]{-2}{=}[0.5cm]{text}}
- Also as seen from the MWE below, some merged (rows + columns) apear normally as shown within the first 2 merged (rows + columns) within the second half of the table.
Here is the MWE:
\documentclass[a4paper,12pt,twoside]{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,margin=2.5cm,bindingoffset=0.5cm]{geometry}
\makeatletter
\def\ifGm@preamble#1{%
\ifGm@newgm
%\Gm@warning{`#1': not available in `\string\newgeometry'; skipped}%
\expandafter\@firstofone
\else
\expandafter\@firstofone
\fi}%
\makeatother
\usepackage[bidi=basic,layout=lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,language=Default]{english}
\babelfont{rm}{Latin Modern Roman}
\babelfont[arabic]{rm}{amiri}
\babelfont[english]{rm}{Times New Roman}
\usepackage{pdflscape}
\usepackage{rotating}
\usepackage[hidelinks,colorlinks=true,breaklinks,allcolors=blue]{hyperref}
\usepackage{fancyhdr}
\usepackage{fancybox, graphicx}
\usepackage[table]{xcolor}
\usepackage{tabu,multirow}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shadows}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{?}[1]{!{\vrule width #1}}
\usepackage{booktabs}
\setlength{\belowrulesep}{0pt}
\setlength{\belowbottomsep}{0pt}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength{\abovetopsep}{0pt}
\usepackage{makecell}
\usepackage{boldline}
\usepackage[skins,xparse,breakable]{tcolorbox}
\begin{document}
\newgeometry{landscape,margin=2.5cm}
\pagewidth = \paperwidth
\pageheight = \paperheight
\fancyheadoffset[lh]{0pt}%
\begin{table}[htbp]
\setlength\arrayrulewidth{1pt} % so that lines apear since they get overried by rowcolors command
\begin{center}
\begin{tabular}
{
?{1mm}c
?{0.5mm}>{\centering\arraybackslash}m{2cm}
|>{\centering\arraybackslash}c
|>{\centering\arraybackslash}m{3cm}
|>{\centering\arraybackslash}m{3cm}
|>{\centering\arraybackslash}m{3cm}
|>{\centering\arraybackslash}m{2cm}?{1mm}
}
%\rowcolor{white} %Color for first row
\toprule[1mm] %may be used to draw a horizontal line at the top of the table.
%\hline % Not needed here as top rule is used
\textbf{dfdfdfdf}
&
\textbf{الحالة
dffds sdfds
}
&
\multicolumn{2}{|c|}{\textbf{tttt t ttt ttt}}
&
\textbf{rrrrr rrrrrr rrrr rrr}
&
\textbf{ttttttttttttt}
&
\textbf{ttttttt}
\\
\midrule[1mm]
\rowcolor{gray!25}
\cellcolor{white}
&
&
mm
&
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{3-3}
\cmidrule[0.5pt]{5-7}
\rowcolor{gray!25}
\cellcolor{white}
&
&
&
\multicolumn{1}{|>{\centering\arraybackslash}m{8cm}|}{}
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{5-7}
\rowcolor{gray!25}
\cellcolor{white}
&
&
\multirow[c]{-2}{0cm}[0cm]
{mm}
&
\multicolumn{1}{|>{\centering\arraybackslash}m{8cm}|}
{
\multirow[c]{-2}{=}[0.5cm]
{
mm
}}
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{3-7}
\cellcolor{white}
&
\cellcolor{gray!25}
&
\foreignlanguage{coptic}{ⲩ}
&
\multicolumn{1}{|>{\centering\arraybackslash}m{8cm}|}
{
mmmmmm mmmmmm mmm mmm mmm mmmmmmmm mmm mmmm mmmmmmmmm mm
}
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{3-7}
\rowcolor{gray!25}
\cellcolor{white}
&
&
&
\multicolumn{1}{|>{\centering\arraybackslash}m{8cm}|}{ }
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{5-7}
\rowcolor{gray!25}
\cellcolor{white}
&
&
\multirow[c]{-2}{*}[0cm]{mm}
&
\multicolumn{1}{|>{\centering\arraybackslash}m{8cm}|}
{
\multirow[c]{-2}{=}[0cm]
{
في بعض الأحيان لتعبر عن النطق الواضح
}}
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{3-7}
\cellcolor{white}
&
\cellcolor{gray!25}
\multirow[c]{-6}{2cm}[0.5cm]
{
mmmmmm mmmmmm mmm mmm mmm mmmmmmmm
}
&
\multicolumn{2}{|>{\centering\arraybackslash}m{10cm}|}
{
mm
}
&
mm
&
mm
&
mmmm
\\
\cmidrule[1pt]{2-7}
\rowcolor{gray!25}
\cellcolor{white}
&
\cellcolor{white}
&
\multicolumn{2}{|>{\centering\arraybackslash}m{10cm}|}{ }
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{5-7}
\rowcolor{gray!25}
\cellcolor{white}
&
\cellcolor{white}
&
\multicolumn{2}{|>{\centering\arraybackslash}m{10cm}|}
{\multirow[c]{-2}{=}[0cm]{\centering mm}}
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{3-7}
\cellcolor{white}
&
&
\multicolumn{2}{|>{\centering\arraybackslash}m{10cm}|}
{mm}
&
&
mm
&
\\
\cmidrule[0.5pt]{3-4}
\cmidrule[0.5pt]{6-6}
\cellcolor{white}
&
&
\multicolumn{2}{|>{\centering\arraybackslash}m{10cm}|}{}
&
\multirow[c]{-2}{*}[0cm]{mm}
&
mm
&
\multirow[c]{-2}{*}[0cm]{mmmm}
\\
\cmidrule[0.5pt]{5-7}
\cellcolor{white}
&
&
\multicolumn{2}{|>{\centering\arraybackslash}m{10cm}|}
{\multirow[c]{-2}{=}[0cm]{\centering mm}
}
&
mm
&
mm
&
mmmm
\\
\cmidrule[0.5pt]{3-7}
\rowcolor{gray!25}
\cellcolor{white}
\multirow[c]{-13}{*}[0.5cm]{mm}
&
\cellcolor{white}
\multirow[c]{-6}{2cm}[0.5cm]
{
mmmm mmmmm mmm mmmmmmm
}
&
\multicolumn{2}{|>{\centering\arraybackslash}m{10cm}|}
{
mmmmmm mmmmmm mmm mmm mmm mmmmmmmm mmm
}
&
mm
&
mm
&
mmmm
\\
\bottomrule[1mm] %draws a horizontal line to finish off a table
\end{tabular}
\end{center}
\end{table}
\clearpage
\restoregeometry
\pagewidth = \paperwidth
\pageheight = \paperheight
\fancyheadoffset[lh]{0pt}%
\end{document}
{NiceTabular}
ofnicematrix
. – F. Pantigny Aug 15 '20 at 21:04nicematrix
would be a solution for the problems of rules and colors but it's not compatible with bidi... – F. Pantigny Aug 16 '20 at 9:30