ltxprimer-1.0

72

VII . R OWS AND C OLUMNS

Distance from sun (million km) Maximum Minimum

Planet

Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

69 . 4

46 . 8

109 . 0 152 . 6 249 . 2 817 . 4

107 . 6 147 . 4 207 . 3 741 . 6

1512 . 0 3011 . 0 4543 . 0 7346 . 0

1346 . 0 2740 . 0 4466 . 0 4461 . 0

Pluto

The package multirow is what we need to do this painlessly. It has a command

\multirow{ num }{ wd }{ item }

where num is the number of rows to be spanned, wd is the width of this column and item is the text of the item in this column. This can be used as in the following example

\begin{center} \begin{tabular}{|l|r|r|} \hline \multirow{3}{1.5cm}{Planet}

& \multicolumn{2}{p{3.5cm}|}%

{\centering Distance from sun \\ (million km)}\\

\cline{2-3}

& \multicolumn{1}{c|}{Maximum}

& \multicolumn{1}{c|}{Minimum}\\

\hline Mercury & 69.4 & 46.8\\ Venus & 109.0 & 107.6\\ Earth & 152.6 & 147.4\\ Mars & 249.2 & 207.3\\ Jupiter & 817.4 & 741.6\\ Saturn & 1512.0 & 1346.0\\ Uranus & 3011.0 & 2740.0\\ Neptune & 4543.0 & 4466.0\\ Pluto & 7346.0 & 4461.0\\ \hline \end{tabular} \end{center}

But this code does not produce the table above, but only

Made with FlippingBook Publishing Software