# Listing and Tabular in Multicols enviornment

I want to use the multicols environment to display a listing beneath a table:

\begin{multicols}{2}
\begin{lstlisting}[]
.....
\end{lstlisting}

\columnbreak

\begin{table}
\centering
\begin{tabular}{r|c|c|c|c|c}
.....
\end{tabular}
\end{table}
\end{multicols}


But this only displays my listing. Am I missing something?

-

Why not a pair of minipage environments?

\begin{center}
\begin{minipage}[t]{.45\textwidth}
\begin{lstlisting}
...
\end{lstlisting}
\end{minipage}\hfil
\begin{minipage}[t]{.45\textwidth}
\begin{tabular}{...}
...
\end{tabular}
\end{minipage}
\end{center}


Play with the width of the minipage's.

-

The multicol package doesn't support normal floats, like table and figure, only page-wide floats, which are starred forms: table* and figure*.

But you do not need the table environment to create the table, that only causes it to float. You could replace the table environment with a center environment, or drop the surrounding environment altogether. If you need a caption, you can use the captionof command from the caption package.

\documentclass{article}
\usepackage{multicol,listings}
\begin{document}
\begin{multicols}{2}
\begin{lstlisting}[]
.....
\end{lstlisting}
\columnbreak
\begin{center}
\begin{tabular}{r|c|c|c|c|c}
a & b & c & d & e & f
\end{tabular}
\end{center}
\end{multicols}
\end{document}

-