Space between title and table

Asked

Viewed 1,073 times

1

The title of my table is very far from the table itself, I would like to know some way to decrease this spacing.

Imagery:

Code:

\begin{table}[!htb]
    \renewcommand{\arraystretch}{1.5}
    \caption{Cronograma de pesquisa}
    \label{cronograma}
    \begin{center}
        \begin{tabular}{c|c c c c c c c c c c c c}
            \hline 
            ATV & SET & OUT & NOV & DEZ & JAN & FEV & MAR & ABR & MAI & JUN & JUL & AGO \\
            \hline
            1 &  &  &  &  &  &  &  &  &  &  &  & \\             
            2 &  &  &  &  &  &  &  &  &  &  &  & \\
            3 &  &  &  &  &  &  &  &  &  &  &  & \\
            4 &  &  &  &  &  &  &  &  &  &  &  & \\
            5 &  &  &  &  &  &  &  &  &  &  &  & \\
            6 &  &  &  &  &  &  &  &  &  &  &  & \\
            7 &  &  &  &  &  &  &  &  &  &  &  & \\
            8 &  &  &  &  &  &  &  &  &  &  &  & \\
            \hline
        \end{tabular}
    \end{center}
\end{table}

1 answer

4


The command \vspace serves to add or remove vertical spacing in Latex. If a positive number is used, it adds space. If a negative number is used, it removes.

In the case of your table, I removed 5mm between the caption and the table itself. See the code below and then the result I got.

\documentclass{article}

\begin{document}

\begin{table}[!htb]
    \renewcommand{\arraystretch}{1.5}
    \caption{Cronograma de pesquisa}
    \vspace{-5mm}
    \label{cronograma}
    \begin{center}
        \begin{tabular}{c|c c c c c c c c c c c c}
            \hline 
            ATV & SET & OUT & NOV & DEZ & JAN & FEV & MAR & ABR & MAI & JUN & JUL & AGO \\
            \hline
            1 &  &  &  &  &  &  &  &  &  &  &  & \\             
            2 &  &  &  &  &  &  &  &  &  &  &  & \\
            3 &  &  &  &  &  &  &  &  &  &  &  & \\
            4 &  &  &  &  &  &  &  &  &  &  &  & \\
            5 &  &  &  &  &  &  &  &  &  &  &  & \\
            6 &  &  &  &  &  &  &  &  &  &  &  & \\
            7 &  &  &  &  &  &  &  &  &  &  &  & \\
            8 &  &  &  &  &  &  &  &  &  &  &  & \\
            \hline
        \end{tabular}
    \end{center}
\end{table}

\end{document}

inserir a descrição da imagem aqui

  • 1

    Thank you, Marcus. Another method I found was to put caption after Begin{center} and before Begin{tabular}. I didn’t realize I had put away.

  • Well, at least there is another resource if you need to change spacings within your text in Latex. The \vspace serves for the most varied situations, not just tables.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.