# Weird vertical lines with table

Using the code:

\documentclass[a4paper]{article}
\usepackage{ngerman}
\begin{document}
\begin{table}[htb]
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\textbf{Value A}&\textbf{Value B}&\textbf{Value C} \\
\hline
\hline
\\ $$1) & \( 17) & \( 98) \\ \\ \hline \\ \( x = \frac{42}{5} \cdot x + n$$ & $$y = \frac{17}{2} \cdot y + n$$ & $$0$$ \\ \\
\hline
\hline
\end{tabular}
\end{center}
\caption{Stuff}
\end{table}
\end{document}


I get

• And the question is? A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). Jun 22, 2014 at 12:43
• Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Jun 22, 2014 at 12:45
• That is a fair point Jubobs, thank you for editing my original post. I will keep in mind making it compilable in the future. My question is how do I fix the horizontal lines? They aren't long enough to make a proper table. Jun 22, 2014 at 12:46

Don't do

\hline \\


as that generates a truncated line with only the cell in the first column, hence the missing line segments, just do

\\


If you want to space out the array, use \arraystretch.

Good style advice for tables is available in the documentation for the booktabs package. Here it is strongly recommended not to use vertical rules, nor double horizontal rules. Furthermore to provide bigger row spacing in the table you should adjust \arraystretch (which is a command containing a factor) rather than adding blank rows.

\documentclass[a4paper]{article}

\usepackage{ngerman}
\usepackage{booktabs}

\begin{document}

\begin{table}[htb]
\begin{center}
\renewcommand*{\arraystretch}{1.5}
\begin{tabular}{ccc}
\toprule
Bereich (I) in Nm&Bereich (II) in Nm&Bereich (III) in Nm \\
\midrule
$$M_{t1} = 0$$ & $$M_{t2} = 150$$ & $$M_{t3} = 150$$ \\
$$M_{by1}(x) = \frac{450}{43} \cdot x + n$$
& $$M_{by2}(x) = -\frac{450}{43} \cdot x + n$$
& $$M_{by3}(x) = 0$$ \\
$$M_{bz1}(x) = \frac{65}{43} \cdot x + n$$
& $$M_{bz2}(x) = -\frac{65}{43} \cdot x + n$$
& $$M_{bz3}(x) = 0$$ \\
\bottomrule
\end{tabular}
\end{center}
\caption{Momente \textit{abgelesen}}
\end{table}

\end{document}