[comp.text.tex] Simple LaTeX table question

dhosek@sif.claremont.edu (Hosek, Donald A.) (06/28/90)

In article <1990Jun26.224246.15803@cec1.wustl.edu>, mjt@hyperion.wustl.edu (Mike Turmon) writes...

>I have a simple problem with the LaTeX tabular environment.  I can't
>get it to make a table like this:

>			  TITLE
>	----------------------------------------    
>	 Column1	Column2		Column3
>	---------      ---------       ---------     <--- problem here
>	  idiocy	 blah		 nonsense
>	  trash		 stuff		 swill
>	  crap		 garbage	 goo

>The problem is with the lines that extend not quite across the whole
>width of a column.  It is quite easy to make the three lines merge like
>this...

>			  TITLE
>	----------------------------------------    
>	 Column1	Column2		Column3
>	----------------------------------------   <--- easy to do
>	  idiocy	 blah		 nonsense
>	  trash		 stuff		 swill
>	  crap		 garbage	 goo

>....but it is hard to leave some amount of space between the rules.
>There must be an easy way to leave space between the rules, but after a
>lot of fiddling with @-expressions, \clines, etc.,  I couldn't get the
>right things to happen.  Any ideas?

Well, the problem here is that there is no real "intra-column"
space in LaTeX: In the case of the hypothetical column def
  \begin{tabular}{|c||r@{\hspace{24in}ll}
                  1111222222222222222234
the numbers indicate what LaTeX terms as each of the columns 1-4.
\cline and \multispan both use these to determine where to begin
and end lines or spanning columns.

The clever reader may already have a glimmering of how to handle
the problem...

Since our desired result is a broken line like:
  ---   ---   ---
What we need to do is have not three columns, but five (columns
two and four are going to be perpetually empty. The table above
can be specified as:

\begin{aroundtbl}  % The aroundtbl environment can be set to do a 
                   % center, flushright, or flushleft. None of
                   % those environments should be used directly
                   % within the body of a document.
\begin{tabular}{lclcl} % c-columns are the ones which we will
                       % leave blank.
\hline
Column1 && Column2 && Column3 \\ % Note that we have doubled
                                 % ampersands
\cline{1-1} \cline{3-3} \cline{5-5}  
idiocy && blah      && nonsense \\
trash  && stuff     && swill \\
crap   && garbage   && goo 
\end{tabular}
\end{aroundtbl}

>If I find a way to do this, I promise that I won't fill the resulting
>table with crap, garbage, and goo :-).

Sounds like a good plan to me.

-dh


---
Don Hosek                         TeX, LaTeX, and Metafont Consulting and
dhosek@ymir.claremont.edu         production work. Free Estimates.
dhosek@ymir.bitnet                
uunet!jarthur!ymir                Phone: 714-625-0147