2

I've seen the answer someone posted and I implemented it, I would like to keep this configuration as I already based my word using this answer.
Now, the question is, how can I make partial horizontal lines like what does \cline{-}.

Hans
  • 1,013

2 Answers2

6

The makecell package already has, among many other features, the Xhline and \Xcline commands. Examples of use:

\Xhline{1.2pt}
\Xcline{3-6}{2pt}

Excerpt from the doc:

Bernard
  • 271,350
5

In the following, we define a new version of \cline as \Cline where you can provide the required thickness.

\documentclass{article}

\makeatletter
\def\Cline#1#2{\@Cline#1#2\@nil}
\def\@Cline#1-#2#3\@nil{%
  \omit
  \@multicnt#1%
  \advance\@multispan\m@ne
  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
  \@multicnt#2%
  \advance\@multicnt-#1%
  \advance\@multispan\@ne
  \leaders\hrule\@height#3\hfill
  \cr}
\makeatother


\begin{document}

\begin{tabular}{ccc}
  \hline
  A & B & C\\\hline
  D & E & F\\
  \Cline{1-2}{5.0pt}
  G & H & I\\
  \Cline{1-2}{2.0pt}
  J & K & L\\
  \cline{1-2}
\end{tabular}

\end{document}

As can see, you are in control of the thickness when you use \Cline.

enter image description here

And the non-thick standard \cline is always there.

Should need all your \clines (and other lines) to be thick, change \arrayrulewidth to some value you wish.

Masroor
  • 17,842
  • thanks for the reply, but is there a way of fix the height of the cells, please have a loook at the G and H squares, the letters are almost lost. – Hans Apr 26 '14 at 00:32
  • Yes, see the updated answer. – Masroor Apr 26 '14 at 00:50
  • I would like to understand all that you did, is there a book you advice me to learn all this? (btw, accepted answer). – Hans Apr 26 '14 at 00:54
  • The knowledge which played the major role was understanding LaTeX macros. I learned mine from The TeXBook, Chapter 20. But you can try this one as well. And remember, there are no quick ways, initial days have very steep curves. Sounds pedantic? Meant to be. – Masroor Apr 26 '14 at 03:05