Hello all. I really need some help. Is there a way to make the horizontal line thicker? For example:
\begin{table*}
\begin{tabular}{c}
\hspace{16cm} \\
\hline
\vspace{0.25mm} \\
\textbf{\Large TEXT}
\vspace{0.25mm}\\
\hline
\end{tabular}
\end{table*}
In \hline, how to control its width?
In addition, the above code turns out that the upper horizontal line has different distance to the "TEXT" compared with the lower horizontal line. How to make the "TEXT" even between the upper and lower lines. Please help me.
Thanks a lot.
General ⇒ How to control the width of the horizontal line in Table
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
How to control the width of the horizontal line in Table
Hi Zhang,
welcome to the LaTeX Community board! The booktabs package may be useful for you. Here is an example:
Stefan
welcome to the LaTeX Community board! The booktabs package may be useful for you. Here is an example:
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{booktabs}
\begin{document}
\begin{table*}
\centering
\begin{tabular}{c}
\toprule
\textbf{\Large TEXT\strut} \\
\midrule
more text \\
\bottomrule
\end{tabular}
\end{table*}
\end{document}
Re: How to control the width of the horizontal line in Table
Stefan,
Thanks a lot for your suggestion.
It works perfectly for my case after the \toprule and \bottomrule are put in. So the outcome is that the "TEXT" is even distributed between the fully extended thicker horizontal upper and lower lines. For example,
\begin{table*}
\begin{tabular}{c}
\hspace{16cm} \\
%\hline
\vspace{0.25mm} \\
\toprule
\textbf{\Large TEXT\strut}
\vspace{0.25mm}\\
\bottomrule
%\hline
\end{tabular}
\end{table*}
Thanks again. Stefan.
Thanks a lot for your suggestion.
It works perfectly for my case after the \toprule and \bottomrule are put in. So the outcome is that the "TEXT" is even distributed between the fully extended thicker horizontal upper and lower lines. For example,
\begin{table*}
\begin{tabular}{c}
\hspace{16cm} \\
%\hline
\vspace{0.25mm} \\
\toprule
\textbf{\Large TEXT\strut}
\vspace{0.25mm}\\
\bottomrule
%\hline
\end{tabular}
\end{table*}
Thanks again. Stefan.

-
- Posts: 2
- Joined: Mon Jun 27, 2011 4:50 am
How to control the width of the horizontal line in Table
toprule and bottomrule are of fixed structures, i.e., it will add some space avobe & below of each line. To avoid that you can declare your own top and bottom rule like :
\newcommand{\mytoprule}{\specialrule{0.1em}{0em}{0em}}
\newcommand{\mybottomrule}{\specialrule{0.1em}{0em}{0em}}
Just use mytoprule and mybottomrule in stead of toprule and bottomrule respectively. Generic form of specialrule is \specialrule{<wd>}{<abovespace>}{<belowspace>}.
There is a better package - ctable. Check that out!
\newcommand{\mytoprule}{\specialrule{0.1em}{0em}{0em}}
\newcommand{\mybottomrule}{\specialrule{0.1em}{0em}{0em}}
Just use mytoprule and mybottomrule in stead of toprule and bottomrule respectively. Generic form of specialrule is \specialrule{<wd>}{<abovespace>}{<belowspace>}.
There is a better package - ctable. Check that out!
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
How to control the width of the horizontal line in Table
If all you want is a thicker line, you can redefine the array rule thickness:
However, that will also change the thicknesses of any vertical rules as well.
Code: Select all
\setlength{\arrayrulewidth}{1pt}