LaTeX forum ⇒ TeXworkshow to make more space between table caption and table?

Information and discussion about TeXworks, an integrated LaTeX environment for several platforms
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

how to make more space between table caption and table?

Postby yaozhao » Fri Nov 02, 2018 4:47 am

\begin{table} 
\centering 
\caption{First Generation in UW-Madison} 
\scalebox{0.7}{
\begin{tabular}{l*{1}{cc}}
\hline\hline
            &\multicolumn{2}{c}{(1)}  \\
            &\multicolumn{2}{c}{First\_Generation}\\
            &           Freq.&         Percent\\
\hline
Non First Generation&         567&    67\%\\
First Generation in College&         274&    33\%\\
Total       &         841&         100\%\\
\hline
\(N\)       &         841&            \\
\hline\hline
\end{tabular}
}
\label{T1} 
\end{table}


The table formatting is perfect expect but too narrowed between caption and table. How to adjust?

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
mas
Posts: 223
Joined: Thu Dec 04, 2008 4:39 am

how to make more space between table caption and table?

Postby mas » Sat Nov 03, 2018 2:57 am

yaozhao wrote:[code
The table formatting is perfect expect but too narrowed between caption and table. How to adjust?


You can add the required space by using the \vspace.

\begin{table} 
\centering 
\caption{First Generation in UW-Madison} 

\vspace*{5mm}
\scalebox{0.7}{
\begin{tabular}{l*{1}{cc}}
\hline\hline
            &\multicolumn{2}{c}{(1)}  \\
            &\multicolumn{2}{c}{First\_Generation}\\
            &           Freq.&         Percent\\
\hline
Non First Generation&         567&    67\%\\
First Generation in College&         274&    33\%\\
Total       &         841&         100\%\\
\hline
\(N\)       &         841&            \\
\hline\hline
\end{tabular}
}
\label{T1} 
\end{table}

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim

User avatar
Stefan Kottwitz
Site Admin
Posts: 10067
Joined: Mon Mar 10, 2008 9:44 pm

how to make more space between table caption and table?

Postby Stefan Kottwitz » Sat Nov 03, 2018 2:07 pm

Thanks max for answering!

In the meantime also I could take a look. The current table formatting is:

table-original.png
table-original.png (13.46 KiB) Viewed 34668 times


I recommend to use the booktabs package, this gives in my opinion better horizontal lines and distances:

table.png
table.png (16.77 KiB) Viewed 34668 times


\documentclass{article}
\usepackage{graphicx}
\usepackage{booktabs}
\setlength{\heavyrulewidth}{3\lightrulewidth}
\setlength{\abovetopsep}{1ex}
\begin{document}	 
\begin{table} 
  \centering 
  \caption{First Generation in UW-Madison} 
  \label{T1}
  \begin{tabular}{l*{1}{cc}}
    \toprule
              &\multicolumn{2}{c}{(1)}  \\
              &\multicolumn{2}{c}{First\_Generation}\\
              &           Freq.&         Percent\\
    \midrule
    Non First Generation&         567&    67\%\\
    First Generation in College&         274&    33\%\\
    Total       &         841&         100\%\\
    \midrule
    \(N\)       &         841&            \\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}


Stefan
LaTeX.org admin

rais
Posts: 394
Joined: Sun Nov 16, 2014 8:51 pm

how to make more space between table caption and table?

Postby rais » Sat Nov 03, 2018 3:57 pm

For consistent space between caption and table body I'd add
\usepackage[tableposition=top]{caption}

If the now inserted space between caption and table body isn't enough you can control it with caption's skip option.

KR
Rainer


Return to “TeXworks”

Who is online

Users browsing this forum: No registered users and 7 guests