Warning: Creating default object from empty value in /home/customer/www/thevisualscientist.com/public_html/wp-content/themes/engrave-lite/admin/main/inc/class.redux_filesystem.php on line 29
LaTeX Tables – varying line width | LaTeX Tables – varying line width – The Visual Scientist

# LaTeX Tables – varying line width

\hline is not your only option.

One of the easiest ways to vary the line width in your tables is with the booktabs package, which provides lines (or rules) of predefined width.  The lines \toprule, \midrule, and \bottomrule are great to use for a table. Each rule can also be specified, locally or globally, for your own  weighting preferences.

Table using hline:

\begin{document}

\begin{tabular}{ccc}
\hline
1 & 2 & 3 \\
\hline
4 & 5 & 6 \\
\hline
7 & 8 & 9 \\
\hline
\end{tabular}

\end{document}


Output:

Table using booktabs:

usepackage{booktabs}
\begin{document}

\begin{tabular}{ccc}
\toprule
1 & 2 & 3 \\
\midrule
4 & 5 & 6 \\
\midrule
7 & 8 & 9 \\
\bottomrule
\end{tabular}

\end{document}


Output: