Trouble with multi-column table

8 views
Skip to first unread message

Ken

unread,
Mar 6, 2010, 6:00:05 PM3/6/10
to LaTeX Users Group
The below produces the table I want with one exception. How to get
rid of the upper left horizontal bit?

\begin{tabular}{|c|c|c|c|c||c|c|c|c|} \hline
\multicolumn{1}{c}{} & \multicolumn{4}{|c||}{$\beta = 2$} &
\multicolumn{4}{|c|}{$\beta = 8$} \\
\hline
$n$ & $x$ & $y$ & $f$ & $\mu$ & $x$ & $y$ & $f$ & $\mu$ \\ \hline
0 & 10 & 1 & 0 & 3.132 & 10 & 1 & 1.696 & 1.696 \\ \hline
\end{tabular}

Peter Flynn

unread,
Mar 6, 2010, 9:17:37 PM3/6/10
to latexus...@googlegroups.com

\cline{2-9} instead of \hline in the first line of your code will draw a line from column 2 to column 9 (inclusive), thereby omitting the line over column 1.

It would enormously help the documentation writers if you could say whereabouts (apart from Google) you looked for an answer and didn't find it. The \cline command is usually mentioned close to \hline in the standard books, manuals, and online documentation, but it's sometimes not really obvious, so it would help improve the quality of the documentation if you could identify which ones failed to solve the problem for you.

///Peter


Ken

unread,
Mar 7, 2010, 11:02:50 AM3/7/10
to LaTeX Users Group
Thanks. What I did was look in the pdf user guide docs using
'multicolumn' as a search word and looked for examples I thought
illustrated what I wanted. Had I known that it was related to hline,
I probably would have found it. I now see upon closer inspection that
there are examples using cline. I just didn't recognize at the time
that some of the examples, in fact, contained the element I was
looking for.

Peter Flynn

unread,
Mar 7, 2010, 7:06:14 PM3/7/10
to latexus...@googlegroups.com
On Sun, Mar 7, 2010 at 4:02 PM, Ken <ken....@sbcglobal.net> wrote:
Thanks.  What I did was look in the pdf user guide docs

Do you know exactly which onces these were? There are dozens of "user guides" around and they're all different :-)
 
using
'multicolumn' as a search word and looked for examples I thought
illustrated what I wanted.  Had I known that it was related to hline,
I probably would have found it.  I now see upon closer inspection that
there are examples using cline.  I just didn't recognize at the time
that some of the examples, in fact, contained the element I was
looking for.

Excellent, that's really useful information, thanks.


///Peter

Ken

unread,
Mar 7, 2010, 8:02:05 PM3/7/10
to LaTeX Users Group
The user guides I have that have references to multicolumn and cline
are:

LATEX Tutorials (Indian TEX Users Group)
The Not So Short Introduction to LATEX2m (by Tobias Oetiker)

Reply all
Reply to author
Forward
0 new messages