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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
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