我一直在使用\rowcolor{color}
命令,并且我注意到行中的一个单元格与下一个单元格之间总是存在一些空白。
这是我的代码:
\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}
有什么办法可以解决这个问题吗?
答案1
有一个临时的解决方案,虽然可能不是最好的,但它确实有效。
我使用该array
包并将垂直规则设置为 -1pt,它处理了白色空间 --- !{\vrule width -1pt}
。vrule
用于设置粗垂直线(例如,!{\vrule width 2pt}
)。
以下是输出和我的 MWE。
\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}
答案2
该软件包nicematrix
有专门用于解决此类问题的工具。有了环境{NiceTabular}
(和密钥colortbl-like
),即使使用 PDF 渲染器 PDF.js(例如 Firefox、Dropbox 和 Papeeria 使用),您也不会看到任何细白线。
\documentclass[11pt,letterpaper]{report}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{nicematrix}
\definecolor{azultabla}{RGB}{203,220,250}
\begin{document}
\begin{table}[h]
\centering
\footnotesize
\begin{NiceTabular}{ l l l l l l l }[colortbl-like] \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{NiceTabular}
\caption{Coordenada de los puntos conocidos después de sumar las coordenadas individuales}
\label{tab:coordsconocidas}
\end{table}
\end{document}
您需要多次编译(因为nicematrix
在后台使用 PGF/Tikz 节点)。