# tabular + table results in “Not in outer par mode”

LaTeX Error: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.10                 \bgroup


This is the document:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}

\begin{document}

\begin{center}
\begin{tabular}{ c c }
\begin{table}
\bgroup
\def\arraystretch{1.2}
\begin{tabular}{ c c | c | c | }
& & \multicolumn{2}{c|}{P2} \\
& & $a_1$ & $a_2$ \\
\hline
\multirow{2}{*}{P1} & $a_1$ & 0, 0 & 0, 0 \\
& $a_2$ & 0, 0 & 0, 0 \\
\hline
\end{tabular}
\egroup
\caption{Title}
\end{table}
&
Other text
\end{tabular}
\end{center}

\end{document}


What does this mean?

• You are using the wrong order: table should be around tabular (and use \centering instead of center). – TeXnician Aug 31 '18 at 17:16
• bgroup and egroup are suoperfuous, \def\arraystretch{1.2} should be before tabular – Zarko Aug 31 '18 at 17:23

i suspect that you like to obtain the following result:

correct code for above table is:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}

\begin{document}
\begin{table}
\centering
\begin{tabular}{ c c }
\begin{tabular}{ c c | c | c | }
&       & \multicolumn{2}{c|}{P2}   \\
&       & $a_1$ & $a_2$             \\
\hline
\multirow{2}{*}{P1}
& $a_1$ & 0,0   & 0,0               \\
& $a_2$ & 0,0   & 0,0               \\
\hline
\end{tabular}
&
Other text
\end{tabular}
\caption{Title}
\end{table}
\end{document}


for this i suggest to use the tabularx table environment for outer table:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
\begin{table}
\centering
\begin{tabularx}{\linewidth}{ C C }
\begin{tabular}{ c c | c | c | }
&       & \multicolumn{2}{c|}{P2}   \\
&       & $a_1$ & $a_2$             \\
\hline
\multirow{2}{*}{P1}
& $a_1$ & 0,0   & 0,0               \\
& $a_2$ & 0,0   & 0,0               \\
\hline
\end{tabular}
\caption{Title of the first table}
\label{tab:1}
&
\begin{tabular}{ c c | c | c | }
&       & \multicolumn{2}{c|}{P2}   \\
&       & $a_1$ & $a_2$             \\
\hline
\multirow{2}{*}{P1}
& $a_1$ & 0,0   & 0,0               \\
& $a_2$ & 0,0   & 0,0               \\
\hline
\end{tabular}
\caption{Title of the second table}
\label{tab:2}
\end{tabularx}
\end{table}
\end{document}

• Thanks @Zarko! Actually, I would like to have two tables 1 and 2 (instead of "Other Text") The problem with your answer is that I would get only a single title – Juan Leni Aug 31 '18 at 17:54
• Let's say that I actually want to have two tables/grids side by side each with its own title – Juan Leni Aug 31 '18 at 17:55
• @purpletentacle, what is in the second table? – Zarko Aug 31 '18 at 18:33