[Tex/LaTex] Spacing before and after tabular disappears

line-spacingsetspacetables

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}

One row

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

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

Two rows

What should I do to fix this?

Best Answer

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}

enter image description here