Tables – How to Reproduce a Table with Thick Lines in LaTeX

rulestables

I'm trying to reproduce this table:

table with thick first vertical and horizontal lines

(apologies for the terrible cameraphone pic)

I don't know how to get the slightly thicker leftmost and topmost line.

Here's a minimal example of what I have so far:

\documentclass[a4paper,12pt]{article}

\begin{document}

\begin{tabular}{c|c|c|c|c|c}
    $*$ & $a$ & $b$ & $c$ & $d$ & $e$ \\\hline
    $a$ & $a$ & $b$ & $c$ & $b$ & $d$ \\\hline
    $b$ & $b$ & $c$ & $a$ & $e$ & $c$ \\\hline
    $c$ & $c$ & $a$ & $b$ & $b$ & $a$ \\\hline
    $d$ & $b$ & $e$ & $b$ & $e$ & $d$ \\\hline
    $e$ & $d$ & $b$ & $a$ & $d$ & $c$
\end{tabular}

\end{document}

Is there an easy way to make the leftmost and topmost lines thicker?

Best Answer

You could define a thick version of \hline and a thick | as new column type as I did below. Both are based on the original code, only the thickness got changed from \arrayrulewidth to 1pt.

\documentclass[a4paper,png]{standalone}
\usepackage{array}

\makeatletter
\newcommand{\thickhline}{%
    \noalign {\ifnum 0=`}\fi \hrule height 1pt
    \futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1pt\hskip\tabcolsep}}
\makeatother


\begin{document}

\begin{tabular}{c"c|c|c|c|c}
    $*$ & $a$ & $b$ & $c$ & $d$ & $e$ \\\thickhline
    $a$ & $a$ & $b$ & $c$ & $b$ & $d$ \\\hline
    $b$ & $b$ & $c$ & $a$ & $e$ & $c$ \\\hline
    $c$ & $c$ & $a$ & $b$ & $b$ & $a$ \\\hline
    $d$ & $b$ & $e$ & $b$ & $e$ & $d$ \\\hline
    $e$ & $d$ & $b$ & $a$ & $d$ & $c$
\end{tabular}

\end{document}

Result


On request here a definition of a thick version of \cline:

\newcommand{\thickcline}[1]{%
    \@thickcline #1\@nil%
}

\def\@thickcline#1-#2\@nil{%
  \omit
  \@multicnt#1%
  \advance\@multispan\m@ne
  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
  \@multicnt#2%
  \advance\@multicnt-#1%
  \advance\@multispan\@ne
  \leaders\hrule\@height1pt\hfill
  \cr
  \noalign{\vskip-1pt}%
}