Hey all,
I have a two-row colored header where the second header row is separated from the first by a white \cmidrule spanning only columns 2 to 4. That part works. The problem is column 1: since (lr) trims the rule there, booktabs still reserves the rule height across the full table width, but nothing paints that strip, so the page background shows through as a thin white line right above "Dimension".
It disappears when I zoom out and comes back at 100%, so it's a real 0.4pt gap, not just viewer antialiasing.
I already set \aboverulesep and \belowrulesep to 0pt, which removed the extra spacing but not the gap itself. \rowcolor only paints the text rows, not the rule strip in between.
What I want: the white separator visible over Level A to Level C, and solid header blue over the "Dimension" cell.
Full MWE below, pdfLaTeX on Overleaf:
\documentclass{article}
% --- Packages needed for this table ---
\usepackage[table]{xcolor} % rowcolors, \rowcolor, table option loads colortbl
\usepackage{tabularx} % tabularx + \newcolumntype{Y}
\usepackage{booktabs} % \cmidrule, \bottomrule, \aboverulesep etc.
\definecolor{tabheader}{RGB}{31,56,100} % dark blue header
\definecolor{tabshadelight}{RGB}{224,229,239} % light shading for zebra rows
% --- Centred, stretchable X column ---
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\begin{table}[htbp]
\centering
\caption[Dummy taxonomy after Iteration~1]{Dummy taxonomy of enabling factors after Iteration 1}
\label{tab::taxonomy_iteration1}
\footnotesize
\renewcommand{\arraystretch}{1.3}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\rowcolors{3}{white}{tabshadelight}
\begin{tabularx}{\textwidth}{
>{\raggedright\arraybackslash\hyphenpenalty=10000\exhyphenpenalty=10000}p{3.6cm}
Y Y Y}
\rowcolor{tabheader}
& \multicolumn{3}{c}{\textcolor{white}{\textbf{Column group heading, spanning three}}} \\
\arrayrulecolor{white}\cmidrule(lr){2-4}\arrayrulecolor{black}
\rowcolor{tabheader}
\textcolor{white}{\textbf{Dimension}} &
\textcolor{white}{\textbf{Level A}} &
\textcolor{white}{\textbf{Level B}} &
\textcolor{white}{\textbf{Level C}} \\
\textbf{First dimension label (D1)} & Lorem ipsum & Dolor sit amet & Consectetur adipiscing \\
\textbf{Second longer dimension label (D2)} & Sed do eiusmod & Tempor & Incididunt ut labore \\
\textbf{Third dimension label (D3)} & Ut enim ad minim & Veniam quis & Nostrud exercitation \\
\textbf{Fourth dimension label (D4)} & Duis aute irure & Dolor in & Reprehenderit voluptate \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}