表格中闪烁/字段内行与行之间的间隙

表格中闪烁/字段内行与行之间的间隙

我的表格有两个问题:使用 Adob​​e pdf Reader 放大和缩小表格时,表格线条闪烁,有时不可见。第二个问题是线条之间的间隙。使用“tabu”代替“tabular”(我需要 rowfont 命令的 tabu 包)后,字段中两行之间的间隙变大(红色圆圈)。

我该如何解决这两个问题?` 以下是一个例子:

\documentclass{article}

\usepackage{tabu}
\usepackage{colortbl}
\usepackage{tabu}
\usepackage{eurosym}

\begin{document}
    \definecolor{hd_dblue}{RGB}{0,65,120}
    \definecolor{hd_grey}{RGB}{231,232,236}
    \definecolor{hd_lblue}{RGB}{0,160,230}

\newcolumntype{P}[1]{>{\centering\arraybackslash}m{#1}}

\begin{table}[H]
        \taburulecolor{white}
        \begin{tabu}{|>{\columncolor{hd_lblue}}>{\color{white}}P{4cm}| >{\columncolor{hd_grey}}>{\color{white}}r|>{\columncolor{hd_grey}}>{\color{white}}r|>{\columncolor{hd_grey}}>{\color{white}}c|} 
            \hline
            \rowcolor{hd_lblue}Lizenz& einmalige Kosten& Kosten für drei Jahre&User pro Lizenz\\
            \hline
            \hline
        \rowfont{\color{hd_dblue}} \textcolor{white}{NVIDIA Virt Appl Subscription CCU}& - & \$30,00& 1\\
            \hline
            \rowfont{\color{hd_dblue}} \textcolor{white}{NVIDIA Virt WS Subscription CCU}&-&\$750,00& 1\\
            \hline
            \rowfont{\color{hd_dblue}} \textcolor{white}{VMware Horizon View Standard CCU}&  2.325,00\euro& 1.467,00\euro& 10\\
            \hline
            \rowfont{\color{hd_dblue}} \textcolor{white}{Citrix XenApp Advanced Edition CCU}& \$3.050,00& \$2.100,00& 10\\
            \hline
        \rowfont{\color{hd_dblue}} \textcolor{white}{Citrix XenDesktop VDI Edition CCU}&  \$1.650,00&\$1.350,00& 10\\
            \hline
        \end{tabu}
        \caption{Kosten der Lizenzen}
        \label{tab:cost_software}
\end{table}
\end{document}

在图片中你还可以看到缺失的线条: enter image description here

答案1

这是一个相当快速而粗糙的解决方案。它用于setspace解决您的问题并改进了颜色管理(现在在列标题中)。

table

\documentclass{article}

\usepackage{tabu}
\usepackage{colortbl}
\usepackage{tabu}
\usepackage{eurosym}
\usepackage{setspace}

\begin{document}
    \definecolor{hd_dblue}{RGB}{0,65,120}
    \definecolor{hd_grey}{RGB}{231,232,236}
    \definecolor{hd_lblue}{RGB}{0,160,230}

\newcolumntype{P}[1]{>{\centering\arraybackslash}m{#1}}

\begin{table}
        \taburulecolor{white}
        \begin{tabular}{|>{
            \columncolor{hd_lblue}}>{\color{hd_dblue}\begin{spacing}{.8}}P{4cm}<{\end{spacing}\vspace*{-\baselineskip}}| >{
                \columncolor{hd_grey}\color{hd_dblue}}r|>{
                    \columncolor{hd_grey}\color{hd_dblue}}r|>{
                        \columncolor{hd_grey}\color{hd_dblue}}c|}
            \hline
            \rowcolor{hd_lblue}\textcolor{white}{Lizenz}& \textcolor{white}{einmalige Kosten}& \textcolor{white}{Kosten für drei Jahre}&\textcolor{white}{User pro Lizenz}\\\hline\hline
            \textcolor{white}{NVIDIA Virt Appl Subscription CCU}& - & \$30,00& 1\\\hline
            \textcolor{white}{NVIDIA Virt WS Subscription CCU}&-&\$750,00& 1\\\hline
            \textcolor{white}{VMware Horizon View Standard CCU}&  2.325,00\euro& 1.467,00\euro& 10\\\hline
            \textcolor{white}{Citrix XenApp Advanced Edition CCU}& \$3.050,00& \$2.100,00& 10\\\hline
            \textcolor{white}{Citrix XenDesktop VDI Edition CCU}&  \$1.650,00&\$1.350,00& 10\\\hline
        \end{tabular}
        \caption{Kosten der Lizenzen}
        \label{tab:cost_software}
\end{table}
\end{document}

相关内容