# [NTG-context] Re: good-looking tables in context

Patrick Gundlach patrick at gundla.ch
Thu Mar 31 22:32:40 CEST 2005

Hello Hans,

[LaTeX tables]

> what exactly are you missing?

There is a good file that pretty much describes what I am missing
(perhaps haven't found in a manual - I never looked that close):

http://www.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf

There are commands like \toprule, \midrule, \bottomrule that insert
horizontal rules with different thickness (default values, optional
ones can be added with [..] right after the command). Eckhart has sent
an example in his first post.

To get a horizontal rule from column a to column b you can (in LaTeX)
use:

\cmidrule[<wd>](<trim>){a–b}

where wd is the rulethickness, trim is where to cut off a bit, and a,
b the columns. This is a very nice command that I often use.

Table preambles can be complicated... but the next one is pretty
simple:

\begin{tabular}{@{}rll*{22}cv{40em}@{}}

means: to the left of the table, there should be no whitespace (i.e.
the leftmost glyph of the table should be tight to the preceding
glyph) now, there is a right aligned column, two left aligned, 22
centered columns and one type "v" and to the right there should be no
whitespace either. The column type v is defined like this

\newcolumntype{v}[1]{>{\raggedright\hspace{0pt}}p{#1}}

Ragged right but so that the first word can be hyphenated.

Or another columntype could be:

\newcolumntype{R}[1]{%
>{\begin{turn}{90}\begin{minipage}[t][0pt]{#1}\smalltabsize\raggedright\hspace{0pt}}l%
<{\end{minipage}\end{turn}}%
}

that would lead to rotated raggedright text in a smaller font.

I know that ConTeXt tables have a lot of features that LaTeX tables
don't have.

Patrick
--
ConTeXt wiki: http://contextgarden.net