[Tex/LaTex] Table row with white text on black background

colortablestabularx

I am trying to reproduce a table like those in this picture

The table I want to reproduce

So far I have

\noindent
\begin{tabularx}{\textwidth}{| l | X | l | l | }
\hline
& Does the proposed research involve processing of genetic information or personal data (e.g. health, sexual lifestyle, ethnicity, political opinion, religious or philosophical conviction)? & &  \\
\hline
& Does the proposed research involve tracking the location or observation of people? & &  \\
\hline
& I CONFIRM THAT NONE OF THE ABOVE ISSUES APPLY TO MY PROPOSAL  & YES & \\
\hline
\end{tabularx}

How can I get the white text on black background top row of the tables in the picture (which seems to be a three column row where the others are four columns)?. Also, is it possible to get something like the fine double line you see round the outside of the table and in fact all round the white on black top row of the table in the following higher resolution snapshot (click to enlarge):

enter image description here

Best Answer

The idea is to use some of the commands provided by the table option of the xcolor package. The first option would be to use \rowcolor to specify the desired color for the whole row; however, since you need to use \multicolumn to override the default column specification (in order to have centered contents in some cells),the effect of \rowcolor will be lost, so it's better to use \cellcolor inside \multicolumn for the modified cells. The color for the text can be changed using the \textcolor (from the color package) command. These ideas can be better implemented through a new command. To get the fine double line, I used a \fbox (locally changing \fboxsep) to place a frame around the table, and a "fake" row; feel free to change the length according to your needs:

\documentclass{article}
\usepackage{tabularx}
\usepackage[table]{xcolor}

\newcommand\BlackCell[1]{%
  \multicolumn{1}{c|}{\cellcolor{black}\textcolor{white}{#1}}
}

\begin{document}

\begingroup
\noindent
\setlength\fboxsep{0.6pt}\fbox{%
\begin{tabularx}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}{| l | X | l | l | }
\hline
\BlackCell{} & \BlackCell{Research on Human Embryo/Foetus} & \BlackCell{YES} & \BlackCell{Page} \\\hline\multicolumn{4}{c}{}\\[-11.5pt]\hline
& Does the proposed research involve processing of genetic information or personal data (e.g. health, sexual lifestyle, ethnicity, political opinion, religious or philosophical conviction)? & &  \\
\hline
& Does the proposed research involve tracking the location or observation of people? & &  \\
\hline
& I CONFIRM THAT NONE OF THE ABOVE ISSUES APPLY TO MY PROPOSAL  & YES & \\
\hline
\end{tabularx}%
}
\endgroup

\end{document}

enter image description here