如何呈现具有列颜色和水平线的表格?

如何呈现具有列颜色和水平线的表格?

当我尝试构建一个既要使用自定义水平线又要使用列颜色的表格时,我遇到了渲染问题。简而言之,渲染似乎先绘制线条,然后绘制单元格的彩色背景,因此最终结果是水平线扭曲(即可见宽度错误)或完全不可见(如下例中单元格“This work”的顶部边缘)。我该如何防止这种情况发生?

谢谢并问候,豪尔赫。

PS一些注意事项:

- 最终输出必须是 .eps,我可以将其发送给期刊出版商,我目前正在使用 dvips 来实现这一点。

- 我绝不会坚持这个代码;如果有更好的方法可以使用其他包/环境/等实现相同的效果,请告诉我!

- 桌子布局设计超出了我的决策范围(是的,我也讨厌顶部和边缘的那些线条,但老板想要这样!)

代码:

\documentclass{standalone}

\usepackage{booktabs}
% Workaround for avoiding vertical lines to be "cut" by horizontal lines
\aboverulesep=0ex
\belowrulesep=0ex
\renewcommand{\arraystretch}{1.2}

\usepackage{multirow}
\usepackage{multicol}

\usepackage{array}
% My custom thick vertical line
\newcolumntype{?}{!{\vrule width 1pt}}
% For thick horizontal lines
\usepackage{boldline}

% Colors
\usepackage{xcolor,colortbl}
\definecolor{ColumnHighlightColor}{gray}{0.9}

% My custom colored column
\newcolumntype{a}{>{\columncolor{ColumnHighlightColor}}c}


\begin{document}

\begin{small}
\begin{tabular}{?l|l?a?c|c|c|c|c?}
\clineB{3-8}{2.0}
\multicolumn{2}{l?}{}& & VLSI'17& ISSCC'17& VLSI'16& ISSCC'15& ISSCC'14\\
\multicolumn{2}{l?}{}& \multirow{-2}{*}{\textbf{This work}}& [1]& [2]& [3]& [4]& [5]\\ \toprule[1pt]
\multicolumn{2}{?l?}{Input range [V$_{\mathrm{pp}}$]}& 1.6& -& 2.0& -& 2.5& 2.0\\
\multicolumn{2}{?l?}{Sampling rate [Sa/s]}& 600M& 500M& 9G& 2.5G& 500M& 1G\\ \midrule
& LF input& 9.4& 9.1& -& 10.3& 10.5& 11.2\\
\multirow{-2}{*}{ENOB [bit]} & Nyquist& 9.06& 9.1& 10.7& 10& 10.3& 11\\ \midrule
\multirow{2}{*}{SNDR [dB]} & LF input& 58.1& 56.7& -& 64& 64.8& 69\\
& Nyquist& 56.3& 56.6& 66& 61.7& 64& 68\\ \midrule
\multirow{2}{*}{SFDR [dBc]}& LF input& 67.5& 73& 79& 80& 93& 86\\
& Nyquist& 69.2& 69.2& 79& 73& 82& 82\\  \midrule
\multicolumn{2}{?l?}{Power [W]}& 14.2m& 6m& 2330m& 1150m& 550m& 1200m\\
\multicolumn{2}{?l?}{FOMW [J/conv.-step]}& 44f& 22f& 715f& 463f& 849f& 585f\\
\multicolumn{2}{?l?}{FOMS [dB]}& 159.5& 162.8& 152.3& 152.1& 150.6& 154.2\\
\multicolumn{2}{?l?}{Active area [mm$^{2}$]}& 0.621& 0.015& 5.1& -& 2.5& 18\\ \bottomrule[1pt]
\end{tabular}
\end{small}


\end{document}

结果: 在此处输入图片描述

答案1

只需替换\clineB\cmidrule和适当的参数:

\documentclass[border=3pt]{standalone}

\usepackage{booktabs}
% Workaround for avoiding vertical lines to be "cut" by horizontal lines
\aboverulesep=0ex
\belowrulesep=0ex
\renewcommand{\arraystretch}{1.2}

\usepackage{multirow}
\usepackage{multicol}

\usepackage{array}
% My custom thick vertical line
\newcolumntype{?}{!{\vrule width 1pt}}
% For thick horizontal lines
\usepackage{boldline}

% Colors
\usepackage[table]{xcolor}
\definecolor{ColumnHighlightColor}{gray}{0.9}

% My custom colored column
\newcolumntype{a}{>{\columncolor{ColumnHighlightColor}}c}


\begin{document}

\begin{small}
  \begin{tabular}{?l|l?a?c|c|c|c|c?}
    %\clineB{3-8}{2.0}
    \cmidrule[0.8pt](l{-1pt}){3-8}
    \multicolumn{2}{l?}{} & & VLSI'17 & ISSCC'17 & VLSI'16 & ISSCC'15 & ISSCC'14 \\
    \multicolumn{2}{l?}{} & \multirow{-2}{*}{\textbf{This work}} & [1] & [2] & [3] & [4] & [5] \\ \toprule[1pt]
    \multicolumn{2}{?l?}{Input range [V$_{\mathrm{pp}}$]} & 1.6 & - & 2.0 & - & 2.5 & 2.0 \\
    \multicolumn{2}{?l?}{Sampling rate [Sa/s]} & 600M & 500M & 9G & 2.5G & 500M & 1G \\ \midrule
                                                          & LF input & 9.4 & 9.1 & - & 10.3 & 10.5 & 11.2 \\
    \multirow{-2}{*}{ENOB [bit]} & Nyquist & 9.06 & 9.1 & 10.7 & 10 & 10.3 & 11 \\ \midrule
    \multirow{2}{*}{SNDR [dB]} & LF input & 58.1 & 56.7 & - & 64 & 64.8 & 69 \\
                                                          & Nyquist & 56.3 & 56.6 & 66 & 61.7 & 64 & 68 \\ \midrule
    \multirow{2}{*}{SFDR [dBc]} & LF input & 67.5 & 73 & 79 & 80 & 93 & 86 \\
                                                          & Nyquist & 69.2 & 69.2 & 79 & 73 & 82 & 82 \\ \midrule
    \multicolumn{2}{?l?}{Power [W]} & 14.2m & 6m & 2330m & 1150m & 550m & 1200m \\
    \multicolumn{2}{?l?}{FOMW [J/conv.-step]} & 44f & 22f & 715f & 463f & 849f & 585f \\
    \multicolumn{2}{?l?}{FOMS [dB]} & 159.5 & 162.8 & 152.3 & 152.1 & 150.6 & 154.2 \\
    \multicolumn{2}{?l?}{Active area [mm$^{2}$]} & 0.621 & 0.015 & 5.1 & - & 2.5 & 18 \\ \bottomrule[1pt]
  \end{tabular}
\end{small}

\end{document} 

在此处输入图片描述

相关内容