# [texhax] tabular, tabulary, tabularx, tabular* vs. rubber length ---> tabrule environment

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Thu Mar 3 12:52:31 CET 2005

> Hi,
>
> I would like to ask how I can create a tabular environment such that
> all columns stretches over the whole linewidth, and such that the
> left-most column and right-most column have no extra space, e.g.
>
> | left-most       | middle    | middle     | rightmost |
>
>             |______|       |___|       |____| extra space
>
> I note that the tabulary environment has a different way to compute
> column width than tabular. However, when I give tabulary the width
> \linewidth, e.g.
> \begin{tabulary}{\linewidth}{CCC} A & B & C \end{tabulary}, that does
> _not_ extend over the whole line. I tried to add \hspace{\stretch 1}
> after each table element to make it stretch into the whole line, but
> this made no difference. I tried the same thing with tabular but no
> difference.

no tabular of any sort will fill the entire line with that preamble:
there's implicit extra space at each side of every cell, which you
need to cancel.

try \begin{tabulary}{\linewidth}{@{}CCC@{}} A & B & C \end{tabulary}

> In addition, in my wish list, is that fact that I would like all table
> elements to support a command \tag just like the gather-environment. I
> think this would give me a good setting for typesetting inference
> rules, since \tag can put a label to the left of each element. But
> perhaps I can embed the gather-environment in each element (this is
> cumbersome, but works). A better solution is to automatically begin a
> gather environment inside all tables inside this special "tabrule"
> environment.

you need to find a latex programmer with some spare time, unless you
know how to do these things for yourself.