Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
2  
Please always post a complete document showing all packages used. If I zoom in on your image I don't see gaps. In fact TeX places the colour panels exactly adjacent, but some pdf viwers will snap them to pixel boundaries and panels may snap in opposite directions leaving a pixel gap. Please clarify where you are seeing the gap (and what viewer) –  David Carlisle Feb 13 '13 at 21:52
    
Oh, I am sorry. I'm seeing this white gaps (they are quite small) using 'Preview.app'. Although the code's output is a pdf, I posted the image with the .png termination because if you zoom that, the pixels will show you exactly what I'm talking about. I just noticed that this doesn't happen with acrobat reader. –  Francisco Feb 13 '13 at 22:00
    
Hence the problem is with the pdf viewer. Thank you. –  Francisco Feb 13 '13 at 22:06
    
It's still a legitimate question though IMHO because oftentimes documents are produced for screen reading and you can't rely on people using a certain PDF viewer and not another. –  Christian Feb 14 '13 at 3:06
add comment

1 Answer 1

up vote 2 down vote accepted

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}
share|improve this answer
    
It does work :) –  Francisco Feb 14 '13 at 3:21
1  
Is there also a non ad-hoc solution? ;-) –  Frederick Nord Mar 4 at 13:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.