LaTeX forum ⇒ Theses, Books, Title pagesBig tables Topic is solved

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Shafiq Popal
Posts: 9
Joined: Thu Mar 02, 2017 8:31 pm

Big tables

Postby Shafiq Popal » Mon May 15, 2017 11:26 am

Hello everyone,
I need some very big tables to be used for my thesis. One of the tables that I used is attached and the code is also given. But after compiling the file, my table does not appear completely on the page. Any idea how to fit it on the page?

Regards,

  1. \begin{table}[!h]
  2. \caption{Theoretical Strength of Specimens}
  3. \label{tab:ts}
  4. \centering
  5. \begin{tabular}{l l l l l l l}
  6. \toprule
  7. \tabhead{Specimen} & \tabhead{Strengthening Material} & \tabhead{Depth of Compression Block (\textit{$\alpha$, mm})} & \tabhead{Felxural Capacity (\textit{kNm})} & \tabhead{Cracking Moment (\textit{kN})} & \tabhead{Ultimate Load (\textit{kN})} & \tabhead{Enhancement in Bearing Capacity (\textit{\%}}) \\
  8. \midrule
  9. I-SB0-SWR0 & --- & 9.670 & 6.383 & 4.587 & 9.896 & --- \\
  10. II-SB4-SWR0 & 4 Steel Bars \O 6 mm & 15.80 & 9.966 & 5.10 & 15.451 & 56.133 \\
  11. III-SB0-SWR4 & 4 P-SWRs \O 3 mm & 14.650 & 9.369 & 5.338 & 14.525 & 46.776 \\
  12. IV-SB2-SWR2 & 2 Steel Bars \O 6 mm and 2 P-SWRs \O 3 mm & 15.240 & 9.680 & 5.748 & 15.0 & 51.576 \\
  13. V-SB0-SWR8 & 8 P-SWRs \O 3 mm & 19.490 & 12.050 & 7.720 & 18.682 & 88.783 \\
  14. \bottomrule\\
  15. \end{tabular}
  16. \end{table}


01.jpg
01.jpg (49.61 KiB) Viewed 447 times
Last edited by Stefan Kottwitz on Mon May 15, 2017 11:29 am, edited 1 time in total.
Reason: code marked

User avatar
Stefan Kottwitz
Site Admin
Posts: 8307
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon May 15, 2017 11:42 am

Hi!

The table head entries are very long. They would never fit to the page. You could wrap them, having a header with multiple lines, or shorten them. Perhaps, instead of writing Depth of Compression Block (\textit{$\alpha$, mm}), you could write Depth with a footnote that explains what is meant. And the same for other entries.

Alternatively, you could rotate the table by 90 degrees to have more space.

So, possible ways are
  • tabularx table in \textwidth, p and X columns
  • footnotes at the table (threeparttable package)
  • rotated table, using lscape or pdflscape or rotating, sidewaystable

I don't go into details as I don't know yet which way you would like to choose.

Stefan
Site admin

Shafiq Popal
Posts: 9
Joined: Thu Mar 02, 2017 8:31 pm

Postby Shafiq Popal » Mon May 15, 2017 12:52 pm

May I know the package and code for using footnotes under the table because I tried rotating the table but it did not fit ;)

Thanks a lot

User avatar
Stefan Kottwitz
Site Admin
Posts: 8307
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon May 15, 2017 4:38 pm

Here is a complete example with table notes. In addition, I rotated the header to save horizontal space.

  1. \documentclass{article}
  2. \usepackage[hmargin=3cm]{geometry}
  3. \usepackage{booktabs}
  4. \usepackage{array}
  5. \usepackage{threeparttable}
  6. \usepackage{graphicx}
  7. \newcommand{\tabhead}[1]{\textbf{#1}}
  8. \newcommand{\rothead}[1]{\rotatebox{45}{\tabhead{#1}}}
  9. \begin{document}
  10. \begin{table}[!h]
  11. \caption{Theoretical Strength of Specimens}
  12. \label{tab:ts}
  13. \centering
  14. \begin{threeparttable}
  15. \begin{tabular}{l >{\raggedright}p{5em} l l l l l}
  16. \toprule
  17. \tabhead{Specimen} & \tabhead{Material\tnote{1}} &
  18. \rothead{Depth\tnote{1}} & \rothead{Capacity\tnote{3}} &
  19. \rothead{Moment\tnote{4}} & \rothead{Load\tnote{5}} &
  20. \rothead{Enhancement\tnote{5}\quad} \\
  21. \midrule
  22. I-SB0-SWR0 & --- & 9.670 & 6.383 & 4.587 & 9.896 & --- \\
  23. II-SB4-SWR0 & 4 Steel Bars \O 6 mm & 15.80 & 9.966 & 5.10
  24. & 15.451 & 56.133 \\
  25. III-SB0-SWR4 & 4 P-SWRs \O 3 mm & 14.650 & 9.369 & 5.338
  26. & 14.525 & 46.776 \\
  27. IV-SB2-SWR2 & 2 Steel Bars \O 6 mm and 2 P-SWRs \O 3 mm
  28. & 15.240 & 9.680 & 5.748 & 15.0 & 51.576 \\
  29. V-SB0-SWR8 & 8 P-SWRs \O 3 mm & 19.490 & 12.050 & 7.720
  30. & 18.682 & 88.783 \\
  31. \bottomrule\\
  32. \end{tabular}
  33. \begin{tablenotes}
  34. \item[1] Strengthening material
  35. \item[2] Depth of Compression Block (\textit{$\alpha$, mm})
  36. \item[3] Felxural Capacity (\textit{kNm})
  37. \item[3] Cracking Moment (\textit{kN})
  38. \item[3] Ultimate Load (\textit{kN})
  39. \item[3] Enhancement in Bearing Capacity (\textit{\%})
  40. \end{tablenotes}
  41. \end{threeparttable}
  42. \end{table}
  43. \end{document}


table.png
table.png (35.2 KiB) Viewed 422 times


Stefan
Site admin

Shafiq Popal
Posts: 9
Joined: Thu Mar 02, 2017 8:31 pm

Postby Shafiq Popal » Tue May 16, 2017 6:29 am

This is really beyond my expectations. Thank you so much for your help and support.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8307
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue May 16, 2017 11:45 am

I noticed I forgot to adjust the table footnote numbers below the table, I guess you already saw that there are several \item[3]. Just to mention it.

Stefan
Site admin


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 1 guest