General ⇒ How to control the width of the horizontal line in Table
How to control the width of the horizontal line in Table
\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.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
How to control the width of the horizontal line in Table
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
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
\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
Code: Select all
\setlength{\arrayrulewidth}{1pt}