[Tex/LaTex] White space between columns using \rowcolor{somecolor}

colorcolortbltables

I have been using \rowcolor{color} command and I have noticed that there is always some white space between one cell and the next one in the row.

Here is my code:

\documentclass[11pt,letterpaper]{report}
\usepackage{xcolor,colortbl}
\usepackage{booktabs}
\definecolor{azultabla}{RGB}{203,220,250}

\begin{document}

\begin{table}[h]
\centering
\footnotesize
\begin{tabular}{ l l l l l l l } \toprule
Nombre & E (m) & N (m) & Z (m) & E+ $\Delta$ E (m)  & N+ $\Delta$ N(m) & Z+ $\Delta$ Z (m.s.n.m)\\ \toprule
PR1 & 1002,723 & 309,042 & 977,471 & 1134,723 & 182,042 & 940,471\\
PR2 & 1002,723 & 309,042 & 977,471 & 1134,723 & 182,042 & 940,471\\
PR3 & 940,739 & 481,138 & 1005,466 & 1072,739 & 354,138 & 968,466\\
PR4 & 918,88 & 680,901 & 1028,026 & 1050,88 & 553,901 & 991,026\\
PR5 & 896,946 & 962,638 & 1075,09 & 1028,946 & 835,638 & 1038,09\\
PR6 & 896,946 & 962,638 & 1075,09 & 1028,946 & 835,638 & 1038,09\\
PR7 & 913,684 & 787,489 & 1043,07 & 1045,684 & 660,489 & 1006,07\\
\rowcolor{azultabla}PR8 & 947,612 & 633,854 & 1020,237 & 1079,612 & 506,854 & 983,237\\
PR9 & 972,277 & 540,103 & 1006,518 & 1104,277 & 413,103 & 969,518\\
PR10 & 1052,608 & 467,588 & 993,868 & 1184,608 & 340,588 & 956,868\\
\rowcolor{azultabla}J1 & 760,255 & 522,173 & 1099,546 & 892,255 & 395,173 & 1062,546\\
J2 & 708,368 & 815,587 & 1141,531 & 840,368 & 688,587 & 1104,531\\
\rowcolor{azultabla}J3 & 705,587 & 955,072 & 1157,92 & 837,587 & 828,072 & 1120,92\\
J4 & 693,069 & 1132,449 & 1169,837 & 825,069 & 1005,449 & 1132,837\\
A & 770,443 & 1270,618 & 1167,742 & 902,443 & 1143,618 & 1130,742\\
\rowcolor{azultabla}J5 & 1095,914 & 789,757 & 1087,632 & 1227,914 & 662,757 & 1050,632\\
J6 & 1227,941 & 606,524 & 1074,445 & 1359,941 & 479,524 & 1037,445\\
J7 & 1127,539 & 265,15 & 972,463 & 1259,539 & 138,15 & 935,463\\
\rowcolor{azultabla}C & 1080,741 & 242,177 & 968,569 & 1212,741 & 115,177 & 931,569\\ \bottomrule
\end{tabular}
\caption{Coordenada de los puntos conocidos después de sumar las coordenadas individuales}
\label{tab:coordsconocidas}
\end{table}

\end{document}

Most annoying thing in the world

Is there a way I can fix that?

Best Answer

There is an ad hoc solution, which may not be preferable, but it works.

I used the array package and set the vertical rule to -1pt, which dealt with the white space --- !{\vrule width -1pt}. vrule is used to set thick vertical lines (e.g., !{\vrule width 2pt}).

Below is the output and my MWE.

enter image description here

\documentclass{article} 

\usepackage{array}
\usepackage{colortbl}
\usepackage{booktabs}

\begin{document} 
\begin{table}[h]
\centering
\footnotesize
\begin{tabular}{ l !{\vrule width -1pt}l !{\vrule width -1pt}l !{\vrule width -1pt}l !{\vrule width -1pt}l !{\vrule width -1pt}l !{\vrule width -1pt}l } \toprule
Nombre & E (m) & N (m) & Z (m) & E+ $\Delta$ E (m)  & N+ $\Delta$ N(m) & Z+ $\Delta$ Z (m.s.n.m)\\ \toprule
PR1 & 1002,723 & 309,042 & 977,471 & 1134,723 & 182,042 & 940,471\\
PR2 & 1002,723 & 309,042 & 977,471 & 1134,723 & 182,042 & 940,471\\
PR3 & 940,739 & 481,138 & 1005,466 & 1072,739 & 354,138 & 968,466\\
PR4 & 918,88 & 680,901 & 1028,026 & 1050,88 & 553,901 & 991,026\\
PR5 & 896,946 & 962,638 & 1075,09 & 1028,946 & 835,638 & 1038,09\\
PR6 & 896,946 & 962,638 & 1075,09 & 1028,946 & 835,638 & 1038,09\\
PR7 & 913,684 & 787,489 & 1043,07 & 1045,684 & 660,489 & 1006,07\\
\rowcolor{cyan}PR8 & 947,612 & 633,854 & 1020,237 & 1079,612 & 506,854 & 983,237\\
PR9 & 972,277 & 540,103 & 1006,518 & 1104,277 & 413,103 & 969,518\\
PR10 & 1052,608 & 467,588 & 993,868 & 1184,608 & 340,588 & 956,868\\
\rowcolor{cyan}J1 & 760,255 & 522,173 & 1099,546 & 892,255 & 395,173 & 1062,546\\
J2 & 708,368 & 815,587 & 1141,531 & 840,368 & 688,587 & 1104,531\\
\rowcolor{cyan}J3 & 705,587 & 955,072 & 1157,92 & 837,587 & 828,072 & 1120,92\\
J4 & 693,069 & 1132,449 & 1169,837 & 825,069 & 1005,449 & 1132,837\\
A & 770,443 & 1270,618 & 1167,742 & 902,443 & 1143,618 & 1130,742\\
\rowcolor{cyan}J5 & 1095,914 & 789,757 & 1087,632 & 1227,914 & 662,757 & 1050,632\\
J6 & 1227,941 & 606,524 & 1074,445 & 1359,941 & 479,524 & 1037,445\\
J7 & 1127,539 & 265,15 & 972,463 & 1259,539 & 138,15 & 935,463\\
\rowcolor{cyan}C & 1080,741 & 242,177 & 968,569 & 1212,741 & 115,177 & 931,569\\ \bottomrule
\end{tabular}
\caption{Coordenada de los puntos conocidos después de sumar las coordenadas individuales}
\label{tab:coordsconocidas}
\end{table}

\end{document}
Related Question