I am trying to produce a table with the following command, but I found
the lines produced by "\cline" are too short, they can not reach with
the vertical
border line at the leftmost and rightmost side. While the lines
produced by
"\hline" are too long, they cross with the vertical border line and
continue extend left and right. I have noticed that many tables
produced on the web
are quite good, but I don't know how to produce such a table in Latex?
Thank you very much for help!
Cheers,
Michael
\begin{center}
\caption{{\it Research Plan}} \label{tab:ResearchPlan}
\begin{small}
\begin{tabular}{lllllll}
& {\bf Time} & & {\bf Task} & & {\bf Output} \\
\hline
\vline & Oct 6 03 - & \vline & Literature review, understand the
& \vline & Two-month report & \vline\\
\vline & Dec 6 03 & \vline & project, write two-month
report & \vline & & \vline\\\cline{2-6}
\hline
\end{tabular}
\end{small}
\end{center}
\end{table}
> Dear all,
>
> I am trying to produce a table with the following command, but I found
> the lines produced by "\cline" are too short, they can not reach with
> the vertical
> border line at the leftmost and rightmost side. While the lines
> produced by
> "\hline" are too long, they cross with the vertical border line and
> continue extend left and right. I have noticed that many tables
> produced on the web
> are quite good, but I don't know how to produce such a table in Latex?
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{tabular}{|l|l|l|}
\multicolumn{1}{l}{\bfseries Time} &
\multicolumn{1}{l}{\bfseries Task} &
\multicolumn{1}{l}{\bfseries Output} \\
\hline
{\Large\strut}% for more space after the line
Oct 6 03 - & Literature review, understand the & Two-month report \\
Dec 6 03 & project, write two-month report &\\\hline
\end{tabular}
\end{document}
And read in the documentation of booktabs about good tabular layouts.
--
Ulrike Fischer
e-mail: zusätzlich meinen Vornamen vor dem @ einfügen.
e-mail: add my first name between the news and the @.
Try using the booktabs package (or the memoir class) and don't use
vertical lines.
(The \it, \bf, etc., commands are deprecated. Don't use them, instead
use \textit{...} or {\itshape ...}, etc.)
Peter W.
--
The English FAQ is at: http://www.tex.ac.uk/faq
Examples of all symbols:
http://www.ctan.org/tex-archive/info/symbols/comprehensive
PostScript fonts:
http://www.ctan.org/tex-archive/info/Type1fonts/fontinstallationguide.pdf
Graphics & floats: http://www.ctan.org/tex-archive/info/epslatex.pdf
"Peter Wilson" <peter.r...@boeing.com> wrote in message
> "Michael" <liqiu...@hotmail.com> wrote in message
> > Dear all,
> >
> > I am trying to produce a table with the following command, but I
found
> > the lines produced by "\cline" are too short, they can not reach
with
> > the vertical
> > border line at the leftmost and rightmost side. While the lines
> > produced by
> > "\hline" are too long, they cross with the vertical border line
and
> > continue extend left and right. I have noticed that many tables
> > produced on the web
> > are quite good, but I don't know how to produce such a table in
Latex?
> > Thank you very much for help!
> >
> > Cheers,
> > Michael
[code snipped]
How about something like that:
---[code]---
\begin{tabular}{@{}l@{}l@{}l@{}}
\multicolumn{1}{l}{\bf Time} & \multicolumn{1}{l}{\bf Task} &
\multicolumn{1}{l}{\bf Output} \\ \hline
\begin{tabular}{|l}
Oct 6 03 - \\
Dec 6 03 \\
\end{tabular} &
\begin{tabular}{|l|}
Literature review, understand the \\
project, write two-month report \\
\end{tabular} &
\begin{tabular}{l|}
Two-month report \\ \\
\end{tabular} \\ \hline
\end{tabular}
---[end of code]---
Or maybe:
---[code]---
\begin{tabular}{|p{.6in}|p{2in}|l|}
\multicolumn{1}{l}{\bf Time} & \multicolumn{1}{l}{\bf Task} &
\multicolumn{1}{l}{\bf Output} \\ \hline
Oct 6 03 - Dec 6 03 & Literature review, understand the project,
write two-month
report & Two-month report \\ \hline
\end{tabular}
---[end of code]---
(You may need to change the width, though)
HTH,
Ben
--
Real address: first name at robotics dot stanford dot edu
> I am trying to produce a table with the following command, but I found
> the lines produced by "\cline" are too short, they can not reach with
> the vertical border line at the leftmost and rightmost side. While the lines
> produced by "\hline" are too long
There is a lot to recommend for entering \vline explicitly, particularly
for filling with \extracolsep (which you don't have) so I will confine
my answer to formatting a table with explicit \vline.
This style is best implemented by setting \tabcolsep = 0 and using
\extracolsep between columns, and I will take the opportunity to
specify the tabular will fill the whole line width
\caption{{\it Research Plan}} \label{tab:ResearchPlan}
\begin{small}
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\linewidth}{l@{\extracolsep{7pt plus 1fill}}llllll}
& {\bf Time} & & {\bf Task} & & {\bf Output} \\\hline
\vline & Oct 6 03 - & \vline & Literature review, understand the
& \vline & Two-month report & \vline\\\cline{5-7}
\vline & Dec 6 03 & \vline & project, write two-month
report & \vline & & \vline\\\hline
\end{tabular*}
\end{small}
Note that you can also put the \vline into the template, like
\begin{tabular*}{\linewidth}{l@{\vline \extracolsep{7pt plus 1fill}}l%
l@{\vline}ll@{\vline}ll@{\vline}}
but then it is harder to omit them (you could define:
\def\novline{\multicolumn{1}{l}{}}
to omit them.)
Donald Arseneau as...@triumf.ca