## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Line on top cells Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
bstex
Posts: 27
Joined: Mon Oct 23, 2017 10:22 am

### Line on top cells

Hi,
Screen Shot 2017-11-04 at 18.10.10.png (54.28 KiB) Viewed 166 times

with this code:
\documentclass[11pt,a4paper]{book} \usepackage[table]{xcolor} \begin{document} \begin{table}\centering\arrayrulecolor{black}\begin{tabular}{l|ccccc|}\cline{2-6}\rowcolor{red}\multicolumn{1}{c|}{\cellcolor{white}A} & B & C & D & E & F \\ \hline\multicolumn{1}{|l|}{G}  & H & I & J  &   K   & L  \\ \hline\multicolumn{1}{|l|}{M}  &  N & O  & P & Q & R  \\ \hline\multicolumn{1}{|l|}{S}  &  T  & U &  V & W & X    \\ \hline\end{tabular}\end{table} \end{document}

but the cline on the top of the table is not visible?
How can I make it visible?
Thank you.

Stefan Kottwitz
Posts: 8527
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
This shifts the line a bit up to make it visible:

\cline{2-6}\noalign{\vskip.3pt}

Stefan

bstex
Posts: 27
Joined: Mon Oct 23, 2017 10:22 am
I still can't believe that I had to MOVE the line just to make it be seen.
Come on, LaTeX does billion of things, it cannot make a line to be seen over a colorful cell?
Thank you very much for the solution, Stefan.

Johannes_B
Site Moderator
Posts: 3584
Joined: Thu Nov 01, 2012 4:08 pm
The line is drawn first, the colour added on top of it.

Something many users trip over.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

bstex
Posts: 27
Joined: Mon Oct 23, 2017 10:22 am
I'm fine with the solution you provided, Stefan and thank you again.
I just want to add this:
I was trying to manage making the cline be seen with transparent colors, but I couldn't make it. I thought that if the background of the red cells was transparent, maybe the cline would be visible.
Is it possible?

Stefan Kottwitz
Posts: 8527
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
I think the normal color support does not work with transparency. But TikZ does. So one could create a table using TikZ, with transparent colors, see here for example:

TikZ can be used with layers. So it is possible, to have all table lines on the foreground layer, and the color filling on the background layer.

Stefan