I am using the command multicols as it is the best option for me. However, I have to introduce a table and I want to addd a caption. If I use the enviroment table it does not work, the table disappear.
Asked
Active
Viewed 1,219 times
1
1 Answers
1
Two methods
-- with the makebox and minipage with tabular environment and caption
-- with the tabular and captionof environment since multicols does not accept normal caption
with inputs from --
How to put captions below tables residing in multiple columns
and
tables side-by-side using minipage
\documentclass[]{article}
\usepackage{multicol}
\usepackage{caption}
\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[1]\\
{
\begin{center}
\begin{tabular}{ |c|c|c|c| }
\hline
i & 1 & 2 & 3\\
\hline
$N_2$ & 1 & 0 & 1\\
\hline
\end{tabular}
\captionof{table}{Lets see}\label{pinki}
\end{center}
}
\blindtext[2]
\end{multicols}
\end{document}
js bibra
- 21,280

\documentclassand ending with\end{document}that produces the problem described. Then that gives a potential helper something to experiment with, without having to guess. – barbara beeton Nov 13 '20 at 20:04tableenvironment inside of amulticolsenvironment, you should receive a warning such as " Floats and marginpars not allowed insidemulticolsenvironment!.". Themulticoldocumentation also explicitly states ". LATEX’s float mechanism, however, is partly disabled in this implementation. At the moment only page-widefloats (i.e., star-forms) can be used within the scope of the environment". – leandriis Nov 13 '20 at 20:07\captionofcommand from thecaptionpackage and replace thetableenvironment with thecenterenvironment, provided you want to horizontally center your table within its column. – leandriis Nov 13 '20 at 20:09