# Writing table side by side in Latex

\renewcommand{\arraystretch}{1.5}
\begin{tabular}{ | m{1.5cm} | m{.75cm}| m{.75cm} |  m{.75cm}| m{.75cm}| m{.75cm} |  m{.75cm}| m{1.5cm} |}

\hline
\textbf{prime $p$:}  & $p_1$ & $p_2$ & $p_3$ & $p_4$ & $p_5$ & ... & $p_n < B_m$ \\

\hline
\end{tabular}\
\centering
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{ | P{1.25cm} | P{2cm}|}
\hline
$p^{'}_1$  & $r_{1}^{1}$, $r_{1}^{1}$  ,$r_{1}^{1}$  ,$r_{1}^{1}$  \\
.  & . \\
$p^{'}_1$  & $r_{1}^{1}$, $r_{1}^{1}$  ,$r_{1}^{1}$  ,$r_{1}^{1}$  \\
$p^{'}_1$  & $r_{1}^{1}$, $r_{1}^{1}$  ,$r_{1}^{1}$  ,$r_{1}^{1}$  \\

\hline
\end{tabular}

• Welcome to TeX.SE. Please don't post fragments of code only. Provide a compilable document, please. You could wrap an outer \begin{tabular}{cc}...\end{tabular} around the two tabular environments to place them side by side
– user31729
Apr 10, 2017 at 7:35
• You might want to remove the \centering before the second table. Apr 10, 2017 at 7:48

I am not entirely certain, but this answer supports my intuition/belief that \centering starts a new paragraph, or at least a new line. That is why your tables don't appear next to each other. I also fail to see the purpose of \centering in your code fragment. Maybe you want it before the first table, so that the entire construct of your two tables is centered. In that case you can solve two problems at once, by moving \centering before your first table.