# How to draw two \hline and two vertical line?

I want to draw a table with two \hline and two vertical line. But as shown in the figure, the first vertical line do not cross the two hline. How to solve this problem?

\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}


-
Minimize the use of vertical lines in tables. They disturb more than they help. –  Svend Tveskæg Jan 2 '14 at 10:00

As stated in the hhline package documentation, | gives you a vertical line which cuts through a double (or single) hline, whereas # gives a double hline segment between two vlines.

So, to correct your situation (leaving aside the aesthetic issues) simply use, # in place of the | in the argument for \hhline.

\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}


You get the following output.

For further reading, please see the hhline package documentation mentioned above. Also, you may like to see this question as well.

-

Don't use vertical lines in tables; they disturb more than they help.

\documentclass{article}

\usepackage{booktabs}

\begin{document}

\begin{tabular}{ccc}
\toprule
1 & 2 & 3 \\
\midrule
4 & 5 & 6 \\
\midrule
7 & 8 & 9 \\
\bottomrule
\end{tabular}

\end{document}


-
It is not the answer to OP's question. –  Przemysław Scherwentke Jan 2 '14 at 10:43
@PrzemysławScherwentke I don't agree with you. We've hand a "don't do this" answers with alternative provided before. Since TeX is about typography, it's not wrong to provide typographical alternatives to what OP asks for. See e.g. What's the quickest way to write “2nd” “3rd” etc in LaTeX –  yo' Jan 2 '14 at 13:53
Thanks so much! It is beautiful but MMA gives the answer 'to' the question. –  Eden Harder Jan 2 '14 at 14:21
@tohecz Yeah! I agree with you! +1 –  Eden Harder Jan 2 '14 at 14:21
@EdenHarder That's just fine. :) I just wouldn't do it like that at all. –  Svend Tveskæg Jan 2 '14 at 14:52