Graphics, Figures & TablesUnderlining Text in Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Underlining Text in Table

Post by latexhelp1 »

Is it possible to underline text within a table? \underline{} is not underlining.To clarify, here's an example. I am interested in underlining the word Panel in the table below:

Code: Select all

\begin{center}
\begin{table}
\begin{threeparttable}
\begin{tabular}{lccccccc}
\multicolumn{7}{c}{\textbf{\large{Table:}}} \\
\hline \hline
& & \small{{(1)}} & \small{{(2)}} & \small{{(3)}} & \small{{(4)}} & \small{{(5)}} \\
\midrule
\multicolumn{7}{c}{Panel A:} \\
Variable & & 0.001 & 0.002 & -0.024*** & -0.028 & -0.015*** \\
	&  & \small{(0.001)} & \small{(0.003)} & \small{(0.004)} & \small{(0.078)} & \small{(0.003)} \\
\\
Observations & & 588916 & 588916 & 588916 & 588916 & 588916 \\
$R^2$ & & 0.03 & 0.50 & 0.12 & 0.13 & 0.27 \\
\hline 
\bottomrule
\end{tabular}
\begin{tablenotes}
\vspace{0.2cm}
\scriptsize{

\item Notes: 
}
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{center}
I very much appreciate any help you can provide.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Underlining Text in Table

Post by Stefan Kottwitz »

I can confirm that it works with \underline, I tested it with your code and

Code: Select all

\multicolumn{7}{c}{\underline{Panel} A:} \\
So you are doing something you did not show, for example loading a package which interferes. Unfortunately you did not post a compilable example. A reader has to guess that you load booktabs and the threeparttable package but doesn't know what else you are doing.

Stefan
LaTeX.org admin
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Underlining Text in Table

Post by latexhelp1 »

Dear Stefan,

My deepest apologies. I am very novice to latex, and do not have a very good sense of which of my packages make what parts of my code work. I did not want to post any superfluous code. But yes, I do have usepackage for booktaps and threeparttable.

And the \underline{} part is not working. That is what my original question is in reference to.

Frankly, I have no idea how to make tables. So I'm open to other means of making tables if my code is not good.

I'd very much appreciate any help you could provide.
Stefan_K wrote:I can confirm that it works with \underline, I tested it with your code and

Code: Select all

\multicolumn{7}{c}{\underline{Panel} A:} \\
So you are doing something you did not show, for example loading a package which interferes. Unfortunately you did not post a compilable example. A reader has to guess that you load booktabs and the threeparttable package but doesn't know what else you are doing.

Stefan
Post Reply