[Tex/LaTex] tabular side-by-side

positioningtablestikz-pgf

I am trying to get two tabular constructs side-by-side with a tikz figure in between and can't seem to get what I want using the minipage construct. Here is the code I have

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{picture}
\usepackage{caption}
\usepackage{tikz-rdf}
\usepackage{tikz}
\usepackage{tkz-graph}
\usepackage{tkz-berge}

\usetikzlibrary{shapes,shapes.callouts,,decorations.text,shapes.misc,decorations.pathmorphing,shapes.geometric,backgrounds,fit,positioning,arrows}

\begin{document}

\begin{figure}[t]
\begin{minipage}[b]{.30\textwidth}
  \centering
  \scalebox{.6}{
      \begin{tabular}{| p{1.5cm} | c | c | c |} \hline
        title & nationality & locatedIn & salary \\ 
        ?t & ?n & ?p & ?s \\ \hline
        Professor  &  American & USA &  \$100,000 \\ \hline
        Professor  &  American & China &  \$100,000 \\ \hline
        Assistant Professor  &  Canadian & China &  \$45,000 \\ \hline
        Assistant Professor  &  Canadian & China &  \$45,000 \\ \hline
        Assistant Professor  &  Canadian & China &  \$45,000 \\ \hline
      \end{tabular}
  }
\end{minipage}
%
\begin{minipage}{.2\textwidth}
              \begin{tikzpicture}
                \draw[
                     -triangle 90,
                        line width=1mm,
                        postaction={draw, line width=0.3cm, shorten >=0.3cm, -}
                ] (0,0) -- (1,0);
           \end{tikzpicture}


\end{minipage}
        %
 \begin{minipage}[b]{.30\textwidth}%{80mm}
        \centering
                 \scalebox{.6}{
              \begin{tabular}{| p{1.5cm} | c | c | c |} \hline
                title & nationality & locatedIn & salary \\ 
                ?t & ?n & ?p & ?s \\ \hline
                Professor  &  American & USA &  \$100,000 \\ \hline
                Professor  &  American & China &  \$100,000 \\ \hline
                Assistant Professor  &  Canadian & China &  \$135,000 \\ \hline
              \end{tabular}
            }
        \end{minipage}
        \end{figure}
          \captionof{table}{Current and Mean B with a Reversed Polarity}

        \end{document}

The output I am getting is the following. Any help would be appreciated.

enter image description here

Best Answer

Matrices!

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,positioning}
\begin{document}
\begin{table}
\centering%
\begin{tikzpicture}[scale=0.6,column 1/.style={nodes={text width=1.5cm}}]
\matrix[matrix of nodes,
            draw,
            %outer sep=2mm,
            %
            ] (firsttable) {
        title & nationality & locatedIn & salary \\ 
        ?t & ?n & ?p & ?s \\ \hline
        Professor  &  American & USA &  \$100,000 \\ \hline
        Professor  &  American & China &  \$100,000 \\ \hline
        Assistant Professor  &  Canadian & China &  \$45,000 \\ \hline
        Assistant Professor  &  Canadian & China &  \$45,000 \\ \hline
        Assistant Professor  &  Canadian & China &  \$45,000 \\ 
};

\matrix[matrix of nodes,
            draw,
            right = 2 cm of firsttable.south east,
                        anchor= south west,
            ] (secondtable) {
                title & nationality & locatedIn & salary \\ 
                ?t & ?n & ?p & ?s \\ \hline
                Professor  &  American & USA &  \$100,000 \\ \hline
                Professor  &  American & China &  \$100,000 \\ \hline
                Assistant Professor  &  Canadian & China &  \$135,000 \\
};
 \draw[
                     -triangle 90,
                        line width=1mm,
                        postaction={draw, line width=0.3cm, shorten >=0.3cm, -}
                ] ([xshift=3mm]firsttable.east |- secondtable.west) -- ([xshift=-3mm]secondtable.west);

\foreach \x in {1,2,3}{
\draw (firsttable.north west -| firsttable-1-\x.north east) |- (firsttable.south west -| firsttable-4-\x.north east);
}
\foreach \x in {1,2,3}{
\draw (secondtable.north west -| secondtable-1-\x.north east) |- (secondtable.south west -| secondtable-4-\x.north east);
}
\end{tikzpicture}
\caption{Current and Mean B with a Reversed Polarity}
\label{tikztable}
\end{table}
\end{document}

enter image description here

EDIT: I've repositioned the table and drawn verticle seperators. However it is strongly recommended to avoid vertical seperators but that's a whole another story and I am not literate enough to comment on that.