Space between title and table

1

The title of my table is a long way from the table itself, I'd like to know some way to narrow it down.

Picture:

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}
    
asked by anonymous 13.08.2018 / 15:15

2 answers

3

The \vspace command is for adding or removing 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 5 millimeters 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}

    
13.08.2018 / 15:28
0

The space was created by \begin{center} ... \end{center} . Do not use this within floats. Another solution to changing the space between captions and figures / tables is to use the package caption :

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[skip=6pt]{caption}



\begin{document}

\begin{table}[!htb]
    \renewcommand{\arraystretch}{1.5}
\centering    
    \caption{Cronograma de pesquisa}
    \label{cronograma}
    \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{table}

\end{document}
    
18.10.2018 / 23:28