LaTeX tables: How do I make thicker or thinner horizontal lines (typically \hline)?

Your question suggests that you might be interested in setting tabular rules (\hline's) of different weight in order to improve your typography rather than for the purposes of some simple "one-off" adjustment. If so, you should consider the booktabs package (if you haven't already done so). It provides canned weighted rules (\toprule, \midrule, etc) which, for typographical reasons, are defined in terms of fractions of em's rather than pt's, although these are very easy to define in pt's as well. Each rule can be locally or globally parameterised for your own specific weighting requirements. The package also provides macros like \heavyrulewidth and \lightrulewidth which you can use "as is" or can redefine to suit your particular needs. (Just as the author uses the term 'rule' where others might call it 'line', the author also uses the term 'width' where others might prefer to use 'thickness'.) The package is exceptionally easy to use. As a side-benefit, the documentation contains some very insightful guidelines about the ins and outs of good tabular typography.


\usepackage{makecell}

and use e.g.

\Xhline{2\arrayrulewidth}

instead of \hline


You can also fix the default tickness of \hline or use a\specialrule also from booktabs or ctable package. (Since the ctable package imports booktabs packages, all commands from this package are available as well). This is a MWE:

MWE

\documentclass{article}
\usepackage{ctable} % for \specialrule command

\begin{document}
\centering

Default \texttt{\textbackslash hline}: 
\begin{tabular}{ccc}
\hline
1 & 2 & 3 \\ 
\hline
\end{tabular}
\bigskip

Thicker \texttt{\textbackslash hline}: 
\setlength{\arrayrulewidth}{.3em}
\bigskip
\begin{tabular}{ccc}
\hline
1 & 2 & 3 \\ 
\hline
\end{tabular}
\bigskip

Custom \texttt{special rule}s with  \texttt{ctable} package: 

\begin{tabular}{ccc}
\specialrule{.05em}{1em}{0em} 
 1 & 2 & 3 \\ 
\specialrule{.1em}{.05em}{.05em} 
1 & 2 & 3 \\ 
\specialrule{.2em}{.1em}{.1em} 
1 & 2 & 3 \\ 
\specialrule{.3em}{.2em}{.2em}
 1 & 2 & 3 \\
\specialrule{.4em}{.3em}{.3em}
1 & 2 & 3 \\    
\specialrule{.5em}{.4em}{.4em}
1 & 2 & 3 \\
\specialrule{.6em}{.5em}{0em}
\end{tabular}
\end{document}

Tags:

Rules

Tables