TeXworkshow to make more space between table caption and table?

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

how to make more space between table caption and table?

Post by yaozhao »

Code: Select all

\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 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

how to make more space between table caption and table?

Post by mas »

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.

Code: Select all

\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: 10308
Joined: Mon Mar 10, 2008 9:44 pm

how to make more space between table caption and table?

Post by Stefan Kottwitz »

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 53440 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 53440 times

Code: Select all

\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: 419
Joined: Sun Nov 16, 2014 8:51 pm

how to make more space between table caption and table?

Post by rais »

For consistent space between caption and table body I'd add

Code: Select all

\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
Post Reply