1
\documentclass[11pt]{elsarticle}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tabularx}
\usepackage{array}
\makeatletter
\newcommand{\thickhline}{%
    \noalign {\ifnum 0=`}\fi \hrule height 1pt
    \futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1pt\hskip\tabcolsep}}
\makeatother
\begin{document}

\begin{table}[ht]
    \caption{Overview of notation} \label{tab:notation_TC} \centering \resizebox{5cm}{!}{% 
        \begin{tabular}{l  l }
            %   {
            \thickhline

            \bf Notation & \bf Description \\ [0.75ex]
            \hline
            hey & hello\\

            \thickhline
    \end{tabular}}
\end{table} 
\end{document}

enter image description here

leandriis
  • 62,593
mathslove
  • 141
  • 1
    What about a booktabs based approach, such as \documentclass[11pt]{elsarticle} \usepackage{booktabs} \begin{document} \begin{table}[ht] \caption{Overview of notation} \label{tab:notation_TC} \centering \begin{tabular}{ll} \toprule \bfseries Notation & \bfseries Description\\ \midrule hey & hello\\ \bottomrule \end{tabular} \end{table} \end{document}? – leandriis Jul 22 '21 at 07:57
  • 1
    You mention wanting to increase the width of a row, while keeping the contents in the center, but your image shows that you altered the height of the first row (and you used the "vertical-alignment" tag). Also, does "center" refer to the vertical or horizontal center? Please clarify how the expected output should look like. – leandriis Jul 22 '21 at 07:58
  • Unrelated to the issue, but do not use \resizebox on a table. This will lead to inconsistent font sizes and line widths throughout the document. Also, do not use \bf, but \bfseries or `\textbf{...}?. (See also: “Correct” way to bold/italicize text?) – leandriis Jul 22 '21 at 08:00
  • Thanks a lot @leandriis. The booktabs option u suggested solved the problem. Related to your recent comment. What is the right way to scale down a table? For that I am using \resizebox. – mathslove Jul 22 '21 at 08:06
  • Don't scale a table at all or decrease the font size by using a command such as \small. – leandriis Jul 22 '21 at 08:10
  • Thanks @leandriis. – mathslove Jul 22 '21 at 08:22
  • I suspect what you need is \multicolumn{1}{c}{Notation} etc. – John Kormylo Jul 22 '21 at 14:06

2 Answers2

3

You may try the new LaTeX3 package tabularray:

\documentclass{article}

\usepackage{caption} \usepackage{tabularray}

\begin{document}

\begin{table}[ht] \caption{Overview of notation} \label{tab:notation_TC} \centering \begin{tblr}{colspec={ll},row{1}={m,1cm,font=\bfseries}} \hline[2pt]
Notation & Description \ \hline Hey & Hello \ \hline[2pt] \end{tblr} \end{table}

\end{document}

enter image description here

L.J.R.
  • 10,932
2

enter image description here

\documentclass[11pt]{elsarticle} 
\usepackage{booktabs} 
\begin{document} 
\begin{table}[ht] 
\caption{Overview of notation} 
\label{tab:notation_TC} 
\centering  
% \small % uncomment for a smaller font size in the table
\begin{tabular}{ll} 
\toprule 
\bfseries Notation & \bfseries Description\\ 
\midrule 
hey & hello\\ 
\bottomrule 
\end{tabular} 
\end{table}  
\end{document}
leandriis
  • 62,593