[Tex/LaTex] Subtables, column separate line draws out of table

subfloatstablestabularx

I am using subtable environment to put two tables side by side.

However, the column separate line between the first two columns draws out of the table.

Anyone can help with this issue?

Sample code as follows:

\begin{table}[htbp]
  \small
  \centering
  \caption{Experiment Results-I}
  \subtable[Indexing Performance]{
    \begin{tabular}{c|r|r}
        \hline
        A       & B       & D\\
        \hline
        \hline
        a       & c       & d\\
        \hline
    \end{tabular}
  }
  \subtable[Indexing Performance]{
    \begin{tabular}{c|r|r}
        \hline
        A       & B       & D\\
        \hline
        \hline
        a       & c       & d\\
        \hline
    \end{tabular}
  }
\end{table}

Best Answer

You seem to be using the obsolete package subfigure. Nevertheless your example doesn't show anything irregular.

Try something like this:

\documentclass{article}
\usepackage{subfig}
\begin{document}
\begin{table}[htbp]
  \small
  \centering
  \caption{Experiment Results-I}
  \subfloat[Indexing Performance]{%
    \hspace{.5cm}%
    \begin{tabular}{c|r|r}
        \hline
        A       & B       & D \\
        \hline
        \hline
        a       & c       & d \\
        \hline
    \end{tabular}%
    \hspace{.5cm}%
  }\hspace{1cm}
  \subfloat[Indexing Performance]{%
    \hspace{.5cm}%
    \begin{tabular}{c|r|r}
        \hline
        A       & B       & D  \\
        \hline
        \hline
        a       & c       & d  \\
        \hline
    \end{tabular}%
    \hspace{.5cm}%
  }
\end{table}
\end{document}

With subfig you should use \subfloat rather than \subtable and \subfigure. The \hspace{1cm} is meant to separate the two subtables, the \hspace{.5cm} commands to give some more room for the subcaption (they aren't needed of course if the tables are wider than these).

enter image description here