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: 25
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

  1. \begin{table}
  2. \centering
  3. \caption{First Generation in UW-Madison}
  4. \scalebox{0.7}{
  5. \begin{tabular}{l*{1}{cc}}
  6. \hline\hline
  7. &\multicolumn{2}{c}{(1)} \\
  8. &\multicolumn{2}{c}{First\_Generation}\\
  9. & Freq.& Percent\\
  10. \hline
  11. Non First Generation& 567& 67\%\\
  12. First Generation in College& 274& 33\%\\
  13. Total & 841& 100\%\\
  14. \hline
  15. \(N\) & 841& \\
  16. \hline\hline
  17. \end{tabular}
  18. }
  19. \label{T1}
  20. \end{table}


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

mas
Posts: 214
Joined: Thu Dec 04, 2008 4:39 am

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.

  1. \begin{table}
  2. \centering
  3. \caption{First Generation in UW-Madison}
  4.  
  5. \vspace*{5mm}
  6. \scalebox{0.7}{
  7. \begin{tabular}{l*{1}{cc}}
  8. \hline\hline
  9. &\multicolumn{2}{c}{(1)} \\
  10. &\multicolumn{2}{c}{First\_Generation}\\
  11. & Freq.& Percent\\
  12. \hline
  13. Non First Generation& 567& 67\%\\
  14. First Generation in College& 274& 33\%\\
  15. Total & 841& 100\%\\
  16. \hline
  17. \(N\) & 841& \\
  18. \hline\hline
  19. \end{tabular}
  20. }
  21. \label{T1}
  22. \end{table}

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

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

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


  1. \documentclass{article}
  2. \usepackage{graphicx}
  3. \usepackage{booktabs}
  4. \setlength{\heavyrulewidth}{3\lightrulewidth}
  5. \setlength{\abovetopsep}{1ex}
  6. \begin{document}
  7. \begin{table}
  8. \centering
  9. \caption{First Generation in UW-Madison}
  10. \label{T1}
  11. \begin{tabular}{l*{1}{cc}}
  12. \toprule
  13. &\multicolumn{2}{c}{(1)} \\
  14. &\multicolumn{2}{c}{First\_Generation}\\
  15. & Freq.& Percent\\
  16. \midrule
  17. Non First Generation& 567& 67\%\\
  18. First Generation in College& 274& 33\%\\
  19. Total & 841& 100\%\\
  20. \midrule
  21. \(N\) & 841& \\
  22. \bottomrule
  23. \end{tabular}
  24. \end{table}
  25. \end{document}


Stefan
Site admin

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

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

For consistent space between caption and table body I'd add
  1. \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 2 guests