I have a problem putting a listing (using lstlisting package) within a table. The problem is that I want to put a multiline listing in a row taking 2 columns.
The following minimal example shows what I want to achieve. However, multicolumn wraps the listing on a single line.
\documentclass{article}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{ |l|l| }
\hline
\multicolumn{2}{|l|}{
\begin{lstlisting}^^J
1st line
2nd line
^^J\end{lstlisting}
} \\ \hline
some text & some text \\ \hline
\end{tabular}
\end{center}
\end{table}
\end{document}
I've tried to wrap the listing in a vbox or minipage, but that didn't help.
Any alternatives to multicolumn, or other ways to get a multiline listing in a table like this?

