# Spacing before and after tabular disappears [duplicate]

I have some troubles with spacing before and after tabular boxes. When my table have only one row, everything is okay.

\documentclass{article}
\usepackage{setspace}

\begin{document}
\doublespacing
Some text.

\begin{tabular}{|l|}
\hline
Some text.\\
\hline
\end{tabular}

Some text.
\end{document}


But when I add new row, spacing before and after table disappears!

\begin{tabular}{|l|}
\hline
Some text.\\ \hline
Some text.\\
\hline
\end{tabular}


What should I do to fix this?

## marked as duplicate by Sverre, Schweinebacke, Henri Menke, clemens, TeXnicianApr 26 '17 at 10:38

• usually such a table is inside center or flushleft environments, which would add some space – David Carlisle Apr 25 '17 at 21:59
• \doublespace is the culprit here which leaves enough space when there's a single row in the tabular. With multiple rows (2+), the tabular still acts like a singular item (like a character) on the line it's put, but it's taller than the expected line height, and is therefore just squeezed in... leaving no vertical space above/below. – Werner Apr 25 '17 at 22:01
• So, what should I do to add the same amount of space, as in first example? center and flushleft environments add to much space. – noxwell Apr 25 '17 at 23:19

If you don't like flushleft or center, you could use \vspace:

\documentclass{article}
\usepackage{setspace}

\begin{document}
\doublespacing
\noindent I think the best solution is with \texttt{flushleft} (or \texttt{center}) environment:

\begin{flushleft}
\begin{tabular}{|l|}
\hline
Some text.\\
\hline
Some text.\\
\hline
\end{tabular}
\end{flushleft}
Some text.

\noindent However, you could use \textbackslash\texttt{vspace*} and set any spacing you want:\vspace*{.1\baselineskip}

\noindent
\begin{tabular}{|l|}
\hline
Some text.\\
\hline
Some text.\\
\hline
\end{tabular}\vspace*{.2\baselineskip}

\noindent Some text.
\end{document}