如何在表格中使用 \cmidrule{} 和 \xcolor{} 时消除空白?

如何在表格中使用 \cmidrule{} 和 \xcolor{} 时消除空白?

我一直在努力寻找一种方法来消除表中使用 \cmidrule{} 时的空白(非彩色)。在此处输入图片描述

平均能量损失

\documentclass{article}
\usepackage[table,dvipsnames]{xcolor}
\usepackage{adjustbox,booktabs,float,multirow}
\begin{document}

\begin{table}[H]
\centering
\begin{adjustbox}{max width=\textwidth}
\label{my-label}

\begin{tabular} {p{1.5cm}p{2cm}p{2cm}>{\columncolor{lred}}p{4cm}>{\columncolor{OliveGreen}}p{4cm}p{6cm}}\\\hline

\textbf{HQ {[}\%{]}} & \multicolumn{1}{c}{\textbf{Preparation}} & \multicolumn{1}{c}{\textbf{State}} & \multicolumn{1}{c}{\color{red}\textbf{POPC}}        & \multicolumn{1}{c}{\color{green}\textbf{DPPTE}}            & \multicolumn{1}{c}{\textbf{Comments}}    \\\hline                                                                                                                                                       
\multirow{4}{*}{1}                     & \multirow{2}{*}{Before rinsing}           & Non-oxidized                       & N/A                                                                                                                                                       & N/A                                &                              \\\cmidrule{3-6}                                                                                                                                                                                                                                                                                                                                                                                                   
                                                 &                                                        & Oxidized                               & N/A                                                                                                                                                       & N/A                                 &                                                            \\\cmidrule{2-6}                                                                                                                                                                                                                                                                        & \multirow{2}{*}{After rinsing}             & Non-oxidized                       & See vesicles on surface which haven't ruptured                                                                                  & See vesicles on surface with no rupture          & I am pretty sure I was on the gold surface: vesicles were not moving and I had focused previously using BF mode                                                                                                                                                                               \\\cmidrule{3-6}                                                                                                                                                  
                                                &                                                           & Oxidized                            & See vesicles ruptured and agglomerations of "particles on surface". Cannot FRAP the background (checked to see if there is monolayer instead of bilayer). 
                                                                                                                                                                                    & See some patches, however these are not very big nor homogeneous patches. When performing FRAP photobleaching takes place and very slow recovery is seen.                                                                                                                                                                                                 & This is good hence the slow recovery, since it is much slower than on glass. However, the patches are not nice and big enough to get good enough data to be able to fit and calculate the diffusion coefficient.                                                                                                      \\ \hline


%% [rest of code]
\end{tabular}
\end{adjustbox}
\end{table}
\end{document}

答案1

白色条纹是由于 规则周围的填充造成的booktabs。删除它们的一种方法是将此填充设置为 0,并将其替换为 规则在单元格顶部和底部添加的填充。cellspace包在带有字母前缀的说明符的列中在单元格顶部和底部添加的填充S (或者C如果您使用siunitx):

 \documentclass{article}
\usepackage{colortbl}
    \usepackage[dvipsnames, svgnames, table]{xcolor} % Use colour!
    \usepackage{array, cellspace, multirow, boldline, booktabs, float}
    \setlength\cellspacetoplimit{4pt}
 \setlength\cellspacebottomlimit{4pt}
\usepackage{adjustbox}

    \begin{document}

\begin{table}[H]
\centering
\begin{adjustbox}{max width=\textwidth}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\label{my-label}
\begin{tabular} {p{1.5cm}p{2cm}p{2cm}>{\columncolor{Salmon}}S{p{4cm}}>{\columncolor{OliveGreen}}p{4cm}p{6cm}}
\toprule
\textbf{HQ {[}\%{]}} & \multicolumn{1}{c}{\textbf{Preparation}} & \multicolumn{1}{c}{\textbf{State}} & \multicolumn{1}{Sc}{\color{red}\textbf{POPC}} & \multicolumn{1}{c}{\color{green}\textbf{DPPTE}} & \multicolumn{1}{c}{\textbf{Comments}} \\
\midrule
\multirow{4}{*}{1} & \multirow{2}{*}{Before rinsing} & Non-oxidized & N/A & N/A & \\%
\cmidrule{3-6}
& & Oxidized & N/A & N/A & \\\cmidrule{2-6} & \multirow{2}{*}{After rinsing} & Non-oxidized & See vesicles on surface which haven't ruptured & See vesicles on surface with no rupture & I am pretty sure I was on the gold surface: vesicles were not moving and I had focused previously using BF mode \\%
\cmidrule{3-6}
& & Oxidized & See vesicles ruptured and agglomerations of "particles on surface". Cannot FRAP the background (checked to see if there is monolayer instead of bilayer).
& See some patches, however these are not very big nor homogeneous patches. When performing FRAP photobleaching takes place and very slow recovery is seen. & This is good hence the slow recovery, since it is much slower than on glass. However, the patches are not nice and big enough to get good enough data to be able to fit and calculate the diffusion coefficient. \\
\bottomrule
\end{tabular}
\end{adjustbox}
\end{table}

\end{document} 

在此处输入图片描述

相关内容