[Tex/LaTex] How to put captions below tables residing in multiple columns

multicoltables

I made the following document, consisting of 2 tables in 2 columns:

enter image description here

Code:

\documentclass{article}
\usepackage[a5paper]{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1.5cm,lmargin=0.7cm,rmargin=0.7cm}
\setlength{\parindent}{0cm}
\usepackage{multicol}
\begin{document}
\begin{centering}
\begin{multicols}{2}
\begin{tabular}{ | c | c|c|c| }
  \hline
  i & 1 & 2 & 3\\
  \hline
  $V$ & 10 & 8 & 12\\
  \hline
\end{tabular}

\begin{table}[h!]
\begin{tabular}{ |c|c|c|c| }
  \hline
  i & 1 & 2 & 3\\
  \hline
  $N_2$ & 1 & 0 & 1\\
  \hline
\end{tabular}
\end{table}
\end{multicols}
\par
\end{centering}
\end{document}

How to put \captions beneath each of them like this:

enter image description here

I tried to wrap \tabular into \table environment, but then the table disappeared.

Best Answer

Building on the code that Danie-Els supplied in answer to a related question, I came up with this solution:

\documentclass[]{article}
\usepackage[a5paper]{geometry}
\usepackage{multicol}
\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\begin{table}
\centering
\makebox[0pt][c]{\parbox{0.9\textwidth}{%
\begin{minipage}[b]{0.45\textwidth}
\centering
\begin{tabular}{ | c | c|c|c| }
\hline
i & 1 & 2 & 3\\
\hline
$V$ & 10 & 8 & 12\\
\hline
\end{tabular}        
\caption{xxx}
\label{tab:first}
\end{minipage}
\hfill
\begin{minipage}[b]{0.45\textwidth}
\centering
\begin{tabular}{ |c|c|c|c| }
\hline
i & 1 & 2 & 3\\
\hline
$N_2$ & 1 & 0 & 1\\
\hline
\end{tabular}
\caption{xxxx}
\label{tab:second}
\end{minipage}
}}
\end{table}

\begin{multicols}{2}
\blindtext[5]
\end{multicols}

\end{document}

Here you go

Related Question