TeX - LaTeX Asked by e_moro on April 7, 2021
In the next example we can see that
rowcolor
does not take into account the declaration @{}
in tabular
preambles.
Is this a normal behavior?
Is there some elegant way to avoid that spurious filled space?
documentclass{article}
usepackage{xcolor, colortbl}
begin{document}
begin{tabular}{|c|c|c@{}|}
rowcolor{gray!30}
text & text & text
end{tabular}
end{document}
This might meet your requirement
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}
Correct answer by js bibra on April 7, 2021
The package nicematrix
with its environment {NiceTabular}
tries to solve the problems of the package colortbl
.
Here is the output of {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}
You need several compilations.
Answered by F. Pantigny on April 7, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP