2

Let's consider a very simple table:

\begin{tabular}{c || c | c}
 & x & y \\ \hline \hline
 a & 1 & 2 \\ \hline
 b & 3 & 4
\end{tabular}

This produces the following table:

enter image description here

Notice that at the intersection of the double lines (top left), the vertical lines break and the horizontal lines don't. Is there a way to flip this behavior, i.e. make the horizontal lines break while the vertical lines go through?

2
  • 1
    Do you want vertical rules to begin with?
    – egreg
    Jan 25 at 14:48
  • 1
    Yes, I would like the same table but with the vertical lines "on top" of the horizontal lines
    – Xanshiz
    Jan 25 at 14:50

1 Answer 1

1

It's not difficult with hhline.

\documentclass{article}
\usepackage{hhline}

\begin{document}

\begin{tabular}{c || c | c}
 & x & y \\
\hhline{=||=|=}
 a & 1 & 2 \\ \hline
 b & 3 & 4
\end{tabular}

\end{document}

enter image description here

But the result isn't pretty at all. Compare.

\documentclass{article}
\usepackage{hhline}
\usepackage{booktabs}% for the second table

\begin{document}

\begin{tabular}{c || c | c}
 & x & y \\ 
\hhline{=||=|=}
 a & 1 & 2 \\ \hline
 b & 3 & 4
\end{tabular}
\qquad
\begin{tabular}{@{}ccc@{}}
\toprule
 & x & y \\ 
\midrule
 a & 1 & 2 \\
 b & 3 & 4 \\
\bottomrule
\end{tabular}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.