[OS X TeX] How to fit a table into the letter size paper

Ross Moore ross at ics.mq.edu.au
Mon Dec 29 17:18:53 EST 2008


On 30/12/2008, at 1:43 AM, Kuo-Hsien Chang wrote:

> Dear all,
>
> The table should be fit into the letter size paper, however my code  
> did not allow me to do it.
>
> Please help me and have a look on it.

If you want a wide table to look good, then you
have to put serious work into formatting the row
header cells, by careful choice of styles, sizes,
widths and alignments.

>
> Thanks,
> Michael
>
> \begin{tabular}{lllllllllll}
> \hline
> Soil depth(cm) & Sand(\%) & Silt(\%) & Clay(\%) & BD(gcm-3) & FC 
> (cm3cm-3) & K(cms-1) & WP(cm3cm-3) & pH & Root(\%) & OM(\%) 
> \tabularnewline
> 0−2 & & & & & & & & & & \tabularnewline
> 2−5 & & & & & & & & & & \tabularnewline
> 5−10 & & & & & & & & & & \tabularnewline
> 10−20 & & & & & & & & & & \tabularnewline
> 20−30 & & & & & & & & & & \tabularnewline
> 30−45 & & & & & & & & & & \tabularnewline
> 45−60 & & & & & & & & & & \tabularnewline
> 60−75 & & & & & & & & & & \tabularnewline
>>
> 75−90 & & & & & & & & & & \tabularnewline
> 90−105 & & & & & & & & & & \tabularnewline
> 105−120+ & & & & & & & & & & \tabularnewline
> \hline
> \end{tabular}
>



Here's what can be done, in your case:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: texshop_image.jpeg
Type: image/jpeg
Size: 78742 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20081230/6cd18f6e/attachment.jpeg>
-------------- next part --------------

Here's the modified coding (additions to preamble
and the coding for the table itself):


\newcommand{\cm}{\mathop{\mathrm{cm}}}
\newcommand{\gm}{\mathop{\mathrm{g}}}
\newcommand{\secs}{\mathop{\mathrm{s}}}

\newcommand{\colhead}[2]{{\centering\footnotesize#1\par
   \centering \scriptsize$#2$\par}}
\newcommand{\mycolhead}[3][\normcol]{&\multicolumn{1}{p{#1}}{\colhead 
{#2}{#3}}}
\newcommand{\widecol}{1.5cm}
\newcommand{\medcol}{1.31cm}
\newcommand{\normcol}{.8cm}

\begin{document}
\maketitle

\noindent
{\footnotesize  % local table definitions
\addtolength{\tabcolsep}{-2pt}
%\begin{tabular}{ccccccccccc}
\begin{tabular}{cllllllllll}
\hline
\multicolumn{1}{p{\widecol}}{\colhead{Soil depth}{\cm}}
\mycolhead{Sand}{\%}
\mycolhead{Silt}{\%}
\mycolhead{Clay}{\%}
\mycolhead[\medcol]{BD}{\gm\cm^{-3}}
\mycolhead[\medcol]{FC}{\cm^3\cm^{-3}}
\mycolhead[\medcol]{K}{\cm\sec^{-1}}
\mycolhead[\medcol]{WP}{\cm^3\cm^{-3}}
\mycolhead{pH}{\quad}
\mycolhead{Root}{\%}
\mycolhead{OM}{\%}
\\
\noalign{\vskip-\medskipamount}
0--2 & & & & & & & & & & \\
2--5 & & & & & & & & & & \\
\phantom{1}5--10 & & & & & & & & & & \\
10--20 & & & & & & & & & & \\
20--30 & & & & & & & & & & \\
30--45 & & & & & & & & & & \\
45--60 & & & & & & & & & & \\
60--75 & & & & & & & & & & \\
75--90 & & & & & & & & & & \\
\phantom{1}90--105 & & & & & & & & & & \\
105--120+\kern-8pt& & & & & & & & & & \\
\hline
\end{tabular}
}% end of local table definitions



>

Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the MacOSX-TeX mailing list