0

I'm trying to generate pairs of tables in several different templates. The first table has a "normal" appearance, but the second is a transformation of the first that displays all of the rulings, especially those that are not drawn in the original table. It is important that the original table also includes the horizontal separators because the two images need to be the same size. The second must show the "grid" that shows all independent cells.

An example:

\documentclass[preview]{standalone}
\usepackage{booktabs}\usepackage{colortbl}\begin{document}
\begin{table}
\begin{tabular}{l|cr}
\hline
& Romanization & polverine \\ \arrayrulecolor{black} \hline \arrayrulecolor{black} 
gastratrophia & 9 & 77 \\ \arrayrulecolor{white} \hline \arrayrulecolor{black} 
Adamitical & 3 & 61 \\  \arrayrulecolor{white} \hline \arrayrulecolor{black}
\end{tabular}
\end{table}

\begin{table}
\setlength{\aboverulesep}{0.1pt}\setlength{\belowrulesep}{0.1pt}
\color{white}\arrayrulecolor{red}\begin{tabular}{|l|c|r|}
\hline
 & Romanization & polverine \\ \hline
gastratrophia & 9 & 77 \\ \hline
Adamitical & 3 & 61 \\ \hline
\end{tabular}
\end{table}\end{document}

Which results in the following tables:

enter image description here

I realize that it is really discouraged to use vertical separators in tables, but due to the goal of the table generation I need them. Now as you can see, the white line is drawn over the vertical ruling, which results in a small white gap. I've tried to find ways to make the \hline transparent instead of white, but I cannot find a way to do that.

Is there a way to draw the vertical lines after the horizontal lines, such that they will be placed over the white lines? If not, is there a way of replacing the white lines by some extra vertical spacing that is exactly the size of what a \hline would be?

0

1 Answer 1

1

A working solution is to use \\[0.4pt] for the rows that do not have a \hline. Since a \hline has this width, this compensates for the space that a \hline would produce otherwise. It does not interrupt the vertical lines.

For other ruling types, this is very well written post: booktabs: What is the difference between \toprule and \hline

1
  • Or \\[\arrayrulewidth] in case it changes. Commented May 28, 2019 at 19:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .