[Tex/LaTex] \cline overshoots table using tabularx

clinetablestabularx

I'm having the problem that \cline overshoots the end column of my table after forcing it to have \textwidth.
Is there a way to force it to end in the same place as \hline?

\begin{table}[h]
\centering
\begin{tabularx}{\textwidth}{ c|c|c c|c c } 
\hline
\hline
 &  & \multicolumn{2}{c|}{Dog} & \multicolumn{2}{c}{Bear} \\
 \cline{3-6}
 & Cat & A & B & A & B \\
 \hline 
Value 1 & 0.70 & 0.57 & 0.42 & 0.41 & 0.48 \\ 
Value 2  & 0.10 & 0.051 & 0.07 & 0.03 & 0.022 \\ 
\hline
\end{tabularx}
\end{table}

Best Answer

use

    \begin{tabularx}{\textwidth}{ X|c|c c|c c } 
        \hline
        \hline
        &  & \multicolumn{2}{c|}{Dog} & \multicolumn{2}{c}{Bear} \\
        \cline{3-6}
        & Cat & A & B & A & B \\
        \hline 
        Value 1 & 0.70 & 0.57 & 0.42 & 0.41 & 0.48 \\ 
        Value 2  & 0.10 & 0.051 & 0.07 & 0.03 & 0.022 \\ 
        \hline
    \end{tabularx}

or

    \begin{tabular}{ c|c|c c|c c } 
        \hline
        \hline
        &  & \multicolumn{2}{c|}{Dog} & \multicolumn{2}{c}{Bear} \\
        \cline{3-6}
        & Cat & A & B & A & B \\
        \hline 
        Value 1 & 0.70 & 0.57 & 0.42 & 0.41 & 0.48 \\ 
        Value 2  & 0.10 & 0.051 & 0.07 & 0.03 & 0.022 \\ 
        \hline
    \end{tabular}
Related Question