I'm trying to make a table with the first column and row as colored, but the rest of the cells in white. Though it works almost as expected, there's a thin white line between some cells that should be merged I'd love to get help removing them.
Here's the code I have so far:
\documentclass[10pt]{iopart}
\usepackage[table]{xcolor}
\usepackage{multirow}
\usepackage{hhline}
\begin{document}
\begin{table*}
\begin{tabular}{p{3cm}p{5.25cm}p{5.25cm}}
\rowcolor{black}
&\multicolumn{1}{c}{\textbf{\color{white}Title A}} & \multicolumn{1}{c}
{\textbf{\color{white}Title B}} \\
\cellcolor{black}\textbf{\color{white}Foo A }
& X
& Y \\ \hhline{~--}
\cellcolor{black} & X & Y\\
\cellcolor{black}& X& Y\\
\multirow{-3}{*}{\cellcolor{black}\color{white}Foo B}& X& Y\\ \hhline{~--}
\cellcolor{black}\textbf{\color{white}Foo C}
& X
& Y\\
\cellcolor{black}
& & Y \\
\cellcolor{black}
& & Y \\
\end{tabular}
\caption{Caption.}
\end{table*}
\end{document}
Foo A (Row 2) needs no changing.
Foo C (Rows 6-8) I want to get rid of the white spacing connecting the three rows.
Foo B (Rows 3-5) was my attempt at using a solution I found in this similar question I thought might help by using multirows. Apart from not removing the white line between the cells, it also centers the "Foo B" text vertically, which I don't want.
Ideally, I would like the result to look like this (but with Foo B at the top of its rows):
Thanks!
\cline
. You could usehhline
to draw the rules or use a more modern package such astabularray
which uses different mechanisms to colour the cells.