37

I need to draw a double line after the first row in a table, but when using \hline twice, this interrupts the vertical lines:

\documentclass{article}
\begin{document}

\begin{tabular}{|c|c|c|}
\hline 
1 & 2 & 3 \\ \hline \hline
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\ \hline
\end{tabular}

\end{document}

produces:

enter image description here

This is without using any additional packages. How can I change this is such a ways that the vertical lines are not interrupted?

  • 1
    hhline from package of that name – David Carlisle Aug 30 '13 at 14:17
  • I tried this: 1 & 2 & 3 \\ \hhline{} but then the horizontal line just disappears. I also tried 1 & 2 & 3 \\ \hhline{===} but then the vertical lines were still interrupted. If not that, what is the proper argument for this function? – Jelle Aug 30 '13 at 14:24
  • 6
    The right one is 1 & 2 & 3 \\ \hhline{|=|=|=|} – karlkoeller Aug 30 '13 at 14:28
40

Please always post complete documents:

\documentclass{article}
\usepackage{hhline}
\begin{document}

\begin{tabular}{|c|c|c|}
\hline 
1 & 2 & 3 \\ \hhline{|=|=|=|}
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\ \hline
\end{tabular}

\end{document}

enter image description here

  • 4
    In case you have a table with a double vertical line, see here: tex.stackexchange.com/q/152101/23992 – Keelan Oct 25 '14 at 21:36
  • 1
    I think there's a spelling error, hhline is not defined. Also, I can't seem to get this to work when the layout is |c c|c c|. – Dmitri Nesteruk Mar 17 '15 at 11:33
  • 3
    @DmitriNesteruk if hhline is not defined then you have not copied the code correctly to include the hhline package. – David Carlisle Mar 17 '15 at 11:44
  • @DavidCarlisle ahh, missed that, thanks. incidentally, in my case, the argument ended up being |==|==|... but this makes no sense! :) sigh – Dmitri Nesteruk Mar 17 '15 at 12:33
  • 1
    @DmitriNesteruk why does it make no sense? |==|==| is what I would expect if your columns are specified as |cc|cc| – David Carlisle Mar 17 '15 at 12:35

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.