\ rowcolor 및 @ {} 문제

Sep 15 2020

다음 예 에서는 서문 \rowcolor의 선언을 고려하지 않은 것을 볼 수 있습니다 .@{}tabular

이것은 정상적인 동작입니까? 허위로 채워진 공간을 피하는 우아한 방법이 있습니까?

\documentclass{article}
\usepackage{xcolor, colortbl}

\begin{document}

\begin{tabular}{|c|c|c@{}|} 
\rowcolor{gray!30}
text & text & text
\end{tabular}

\end{document}

답변

2 jsbibra Sep 15 2020 at 15:59

이것은 귀하의 요구 사항을 충족시킬 수 있습니다.

\documentclass{article}
\usepackage{xcolor, colortbl}

\begin{document}

\begin{tabular}{|c|c|>{\kern-\tabcolsep}c<{\kern-\tabcolsep}|} 
\rowcolor{gray!30}
text & text & text
\end{tabular}

\end{document}
4 F.Pantigny Sep 15 2020 at 16:40

패키지 nicematrix의 환경은 {NiceTabular}패키지의 문제를 해결하려고 시도합니다 colortbl.

다음은의 출력입니다 {NiceTabular}.

\documentclass{article}
\usepackage{xcolor}
\usepackage{nicematrix}

\begin{document}
\begin{NiceTabular}{|c|c|c@{}|}[colortbl-like]
\hline
\rowcolor{gray!30}
text & text & text\\
\hline
\end{NiceTabular}
\end{document}

여러 편집이 필요합니다.

2 Zarko Sep 15 2020 at 16:43

당신은 찾고 있습니까 :

\documentclass{article}
\usepackage[table]{xcolor}

\begin{document}
    \begin{tabular}{|c|c| >{\columncolor{white}[\tabcolsep][0pt]}c @{}|}
\rowcolor{gray!30}
text & text & text
    \end{tabular}
\end{document}