Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Shafiq Popal
Posts: 9 Joined: Thu Mar 02, 2017 8:31 pm
Post
by 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,
Code: Select all
\begin{table}[!h]
\caption{Theoretical Strength of Specimens}
\label{tab:ts}
\centering
\begin{tabular}{l l l l l l l}
\toprule
\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{\%}}) \\
\midrule
I-SB0-SWR0 & --- & 9.670 & 6.383 & 4.587 & 9.896 & --- \\
II-SB4-SWR0 & 4 Steel Bars \O 6 mm & 15.80 & 9.966 & 5.10 & 15.451 & 56.133 \\
III-SB0-SWR4 & 4 P-SWRs \O 3 mm & 14.650 & 9.369 & 5.338 & 14.525 & 46.776 \\
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 \\
V-SB0-SWR8 & 8 P-SWRs \O 3 mm & 19.490 & 12.050 & 7.720 & 18.682 & 88.783 \\
\bottomrule\\
\end{tabular}
\end{table}
01.jpg (49.61 KiB) Viewed 14459 times
Last edited by
Stefan Kottwitz on Mon May 15, 2017 11:29 am, edited 1 time in total.
Stefan Kottwitz
Site Admin
Posts: 10290 Joined: Mon Mar 10, 2008 9:44 pm
Post
by 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
LaTeX.org admin
Shafiq Popal
Posts: 9 Joined: Thu Mar 02, 2017 8:31 pm
Post
by 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
Stefan Kottwitz
Site Admin
Posts: 10290 Joined: Mon Mar 10, 2008 9:44 pm
Post
by 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.
Code: Select all
\documentclass{article}
\usepackage[hmargin=3cm]{geometry}
\usepackage{booktabs}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{graphicx}
\newcommand{\tabhead}[1]{\textbf{#1}}
\newcommand{\rothead}[1]{\rotatebox{45}{\tabhead{#1}}}
\begin{document}
\begin{table}[!h]
\caption{Theoretical Strength of Specimens}
\label{tab:ts}
\centering
\begin{threeparttable}
\begin{tabular}{l >{\raggedright}p{5em} l l l l l}
\toprule
\tabhead{Specimen} & \tabhead{Material\tnote{1}} &
\rothead{Depth\tnote{1}} & \rothead{Capacity\tnote{3}} &
\rothead{Moment\tnote{4}} & \rothead{Load\tnote{5}} &
\rothead{Enhancement\tnote{5}\quad} \\
\midrule
I-SB0-SWR0 & --- & 9.670 & 6.383 & 4.587 & 9.896 & --- \\
II-SB4-SWR0 & 4 Steel Bars \O 6 mm & 15.80 & 9.966 & 5.10
& 15.451 & 56.133 \\
III-SB0-SWR4 & 4 P-SWRs \O 3 mm & 14.650 & 9.369 & 5.338
& 14.525 & 46.776 \\
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 \\
V-SB0-SWR8 & 8 P-SWRs \O 3 mm & 19.490 & 12.050 & 7.720
& 18.682 & 88.783 \\
\bottomrule\\
\end{tabular}
\begin{tablenotes}
\item[1] Strengthening material
\item[2] Depth of Compression Block (\textit{$\alpha$, mm})
\item[3] Felxural Capacity (\textit{kNm})
\item[3] Cracking Moment (\textit{kN})
\item[3] Ultimate Load (\textit{kN})
\item[3] Enhancement in Bearing Capacity (\textit{\%})
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
table.png (35.2 KiB) Viewed 14434 times
Stefan
LaTeX.org admin
Shafiq Popal
Posts: 9 Joined: Thu Mar 02, 2017 8:31 pm
Post
by Shafiq Popal » Tue May 16, 2017 6:29 am
This is really beyond my expectations. Thank you so much for your help and support.
Stefan Kottwitz
Site Admin
Posts: 10290 Joined: Mon Mar 10, 2008 9:44 pm
Post
by 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
LaTeX.org admin