minimus wrote, On 2011-11-21 12:52:
> I decided to carry the issue to a new thread as I think it might be
> useful to discuss what is happening with hline, cline, midrules:
>
> In the minimal example below, I made four examples. What I want is the
> the text between the horizontal lines are centered vertically.
>
> \hline and \cline do not really center the text vertically.
>
> \midrule or \cmidrule center the the text vertically. So I would go for
> these commands but now, for some reason, the column lines do not touch
> the row lines.
>
> Hence my questions:
>
> 1. How can I make the text vertically centered while using \hline or
> \cline?
>
> 2. If 1 is not possible, how can I make the column lines touch the row
> lines while using \midrule or \cmidrule?
>
In general, don't use vertical lines. They do not contribute anything to
the understanding of the data. (this is one of the sideeffects of the
booktabs lines, they do not work with vertical lines, thus forcing
authors to prepare data differently).
Reference: Bringhurst: The Elements of Typographic Style (booktabs are
build on these recommendations)
or see the tables presented in the Chicago Manual of Style.
Neither is using vertical lines in their data tables.
I like this quote from Bringhurst:
Tables are notoriously time-consuming
to typeset, but the problems posed are often editorial as much as
typographic. If the table is not planned in a readable form to
begin with, the typographer can render it readable only by
rewriting or redesigning it from scratch.
If the lines are used as column deviders, a similar 'virtual' effect can
be achieved using space between the columns
>
>
>
>
> \documentclass{article}
> \usepackage{array, booktabs}
> \begin{document}
>
> \begin{tabular}{ | m{2cm} | *{11}{m{0.5cm} | } }
> \hline
> Age & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 \\
> \hline
> \end{tabular}
>
> \begin{tabular}{ | m{2cm} | *{11}{m{0.5cm} | } }
> \cline{1-12}
> Age & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 \\
> \cline{1-12}
> \end{tabular}
>
> \begin{tabular}{ | m{2cm} | *{11}{m{0.5cm} | } }
> \midrule[0.04em]
> Age & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 \\
> \midrule[0.04em]
> \end{tabular}
>
> \begin{tabular}{ | m{2cm} | *{11}{m{0.5cm} | } }
> \cmidrule(r){1-12}
> Age & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 \\
> \cmidrule(r){1-12}
> \end{tabular}
>
> \end{document}
--
/daleif (remove RTFSIGNATURE from email address)
Memoir and mh bundle maintainer
LaTeX FAQ:
http://www.tex.ac.uk/faq
LaTeX book:
http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.minimalbeispiel.de/mini-en.html