# [Tex/LaTex] \hline does only go half the way I want it to go

horizontal alignmentline-spacingtables

If I compile the following code, I get a table that is placed very oddly since LaTeX centers it around the double vertical line between the first and second column. My \hline also goes only to right after the first column. The text 'Position' also centers wrongly because of this. I tried to compile in different environments, but this doesn't seem to help.

The code:

\begin{table}
\begin{center}
\begin{tabular}{ r||cccccccc }
\hline
\multirow{2}{*}{Steps} & \multicolumn{8}{c}{Position}\\
\cline{2-8}
& $-3$ & $-2$ & $-1$ & $0$ & $1$ & $2$ & $3$\\
\hline
\hline
$0$ & & & & $1$ & & & \\
$1$ & & & $|b|^{2}$ & & $|a|^{2}$ & &\\
$2$ & & $|a|^{2}|b|^{2}$ & & $|b|^{2}$ & & $|a|^{4}$ &\\
$3$ & $|a|^{4}|b|^{2}$ & & $\left(|b|^{4}-|a|^{2}|b|^{2}+|a|^{4}\right)|b|^{2}$ & & $|a|^{2}|b|^{2}\left(1+3|b|^{2}\right)$ & & $|a|^{6}$\\
$4$ & & \ldots & & \ldots & & \ldots &
\end{tabular}
\end{center}
\end{table}


Anybody any idea?

Would this be what you seek? It seems that you got errors in two places

cline[2-9] and a missing & following it at the end.

Code

\documentclass[12pt]{article}
\usepackage{array}
\usepackage{threeparttable,multirow}

\begin{document}

\begin{table}[hbtp]
\begin{center}
\begin{tabular}{ r||cccccccc}\hline
\multirow{2}{*}{Steps} & \multicolumn{8}{c}{Position}\\  \cline{2-9}
& $-3$ & $-2$ & $-1$ & $0$ & $1$ & $2$ & $3$ & \\
\hline \hline
$0$ & & & & $1$ & & & \\
$1$ & & & $|b|^{2}$ & & $|a|^{2}$ & &\\
$2$ & & $|a|^{2}|b|^{2}$ & & $|b|^{2}$ & & $|a|^{4}$ &\\
$3$ & $|a|^{4}|b|^{2}$ & & $\left(|b|^{4}-|a|^{2}|b|^{2}+|a|^{4}\right)|b|^{2}$ & & $|a|^{2}|b|^{2}\left(1+3|b|^{2}\right)$ & & $|a|^{6}$\\
$4$ & & \ldots & & \ldots & & \ldots &
\end{tabular}
\end{center}
\end{table}

\end{document}