2

I have the following table and try to adjust the row height so that the text is not as crowded as it currently is. Is there a method to do so?

Code:

\documentclass[12pt, a4paper]{report}
\usepackage[margin=20mm]{geometry}
\begin{document}
\begin{table}[]
\begin{tabular}{lll}
\textbf{Variable Conceptualizations} \\
\hline
Variable Function & Variable & Operationalization \\ \hline
Dependent Variable & Z{i,t-1} & $\frac{X_{i,t-1}}{Y_{i,t-1}}$ \\
Independent Variable & Var1 & \begin{tabular}[c]{@{}l@{}}Text\\ Text2\end{tabular} \\
 & Var2 & \begin{tabular}[c]{@{}l@{}}Text\\ Text2\end{tabular} \\
Moderator Variable & Var3 & $\frac{X_{i,t}}{Y_{i,t}}$ \\
Control Variable & Var4 & $ln(X)_{i,t}$ \\
 & X & $\frac{X_{i,t}} {X_{i,t}}$ \\
 & Var5 & $\frac{X_{i,t}}{X_{i,t}}$\\
 & Var6 & \begin{tabular}[c]{@{}l@{}}Text \\ Text2\end{tabular} \\
 & Var7 & \begin{tabular}[c]{@{}l@{}}Text\\ Text2\end{tabular} \\
 & Var8 & $\frac{X}{Y}$ \\
 & Var9 & $\frac{X}{Y}$ \\
 & Var10 & $\frac{X}{Y}$ \\
 & Var11 & Text \\ \hline
 &  &  \\ \hline
\end{tabular}
\caption{CAPTION 1}
\end{table}
\end{document}

Thanks!

3 Answers3

3

Another possibilities is use of the tabularray package and accordingly set its parameters (in your case for example rowsep = 5pt):

\documentclass[12pt, a4paper]{report}
\usepackage[margin=20mm]{geometry}
\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs}
\NewTableCommand\sct{\SetCell{c, m, mode=text}}
\begin{document}
    \begin{table}[ht]
    \centering
\begin{tblr}{colspec = {l Q[l] Q[c, $]},
              row{1} = {font=\bfseries, c},
              row{2} = {mode=text},
              row{3-Z} = {rowsep = 5pt}
             }

\SetCell[c=3]{c} Variable Conceptualizations & & \ \midrule[1pt] Variable Function & Variable & Operationalization \ \midrule Dependent Variable & Zi,t-1 & \frac{X_{i,t-1}}{Y_{i,t-1}} \ Independent Variable & Var1 &\sct {Text\ Text2} \ & Var2 &\sct {Text\ Text2} \ Moderator Variable & Var3 & \frac{X_{i,t}}{Y_{i,t}} \ Control Variable & Var4 & \ln(X){i,t} \ & X & \frac{X{i,t}} {X_{i,t}} \ & Var5 & \frac{X_{i,t}}{X_{i,t}} \ & Var6 &\sct {Text\ Text2} \ & Var7 &\sct {Text\ Text2} \ & Var8 & \frac{X}{Y} \ & Var9 & \frac{X}{Y} \ & Var10 & \frac{X}{Y} \ & Var11 &\sct {Text\ Text2} \ \bottomrule \end{tblr} \caption{CAPTION 1} \end{table} \end{document}

enter image description here

Edit: If you maybe prefer to have in the second column math terms in displaystyle, then change column specification to:

colspec = {l Q[l] Q[c, $$]}

or

colspec = {l Q[l] Q[c, mode=dmath]}

Result is:

enter image description here

Zarko
  • 296,517
2

Here is a solution with the  cellspace package, which defines a minimal vertical spacing in all cells of a column with specifier prefixed with the letter S (or C if you loadsiunitx, or whichever letter you please with the package loading option [column=some letter]). I also took the liberty to simplify your code, replacing the nested tabulars with the \makecell command, and improved the legibility of the resulting .pdf with the \dfrac command, in the place of \frac. Finally, I replaced the \hlines commands with \midrules from booktabs, as they have some vertical spacing above and below.

    \documentclass[12pt, a4paper]{report}
    \usepackage[margin=20mm]{geometry}
    \usepackage{amsmath}
    \usepackage{makecell, booktabs}
    \usepackage{cellspace}
    \setlength{\cellspacetoplimit}{6pt}
    \setlength{\cellspacebottomlimit}{6pt}
\begin{document}

\begin{table}[]
\begin{tabular}{llSl}
\textbf{Variable Conceptualizations} \\
\midrule
Variable Function & Variable & Operationalization \\ \midrule
Dependent Variable & Z{i,t-1} & $\dfrac{X_{i,t-1}}{Y_{i,t-1}}$ \\
Independent Variable & Var1 & \makecell{Text\\ Text2} \\
 & Var2 & \makecell{Text\\ Text2} \\
Moderator Variable & Var3 & $\dfrac{X_{i,t}}{Y_{i,t}}$ \\
Control Variable & Var4 & $\ln(X)_{i,t}$ \\
 & X & $\dfrac{X_{i,t}} {X_{i,t}}$ \\
 & Var5 & $\dfrac{X_{i,t}}{X_{i,t}}$\\
 & Var6 & \makecell{Text \\ Text2} \\
 & Var7 & \makecell{Text\\ Text2} \\
 & Var8 & $\dfrac{X}{Y}$ \\
 & Var9 & $\dfrac{X}{Y}$ \\
 & Var10 & $\dfrac{X}{Y}$ \\
 & Var11 & Text \\ \midrule
 & & \\ \midrule
\end{tabular}
\caption{CAPTION 1}
\end{table}

\end{document} 

enter image description here

Bernard
  • 271,350
1

The environment {NiceTabular} of nicematrix, which is similar to the classical {tabular} has a key cell-space-limits to address that kind of problem.

\documentclass[12pt, a4paper]{report}
\usepackage[margin=20mm]{geometry}
\usepackage{nicematrix,booktabs}

\begin{document} \begin{table}[] \begin{NiceTabular}{@{}lll@{}}[cell-space-limits=3pt] \textbf{Variable Conceptualizations} \ \toprule Variable Function & Variable & Operationalization \ \midrule Dependent Variable & Z{i,t-1} & $\frac{X_{i,t-1}}{Y_{i,t-1}}$ \ Independent Variable & Var1 & \begin{tabular}[c]{@{}l@{}}Text\ Text2\end{tabular} \ & Var2 & \begin{tabular}[c]{@{}l@{}}Text\ Text2\end{tabular} \ Moderator Variable & Var3 & $\frac{X_{i,t}}{Y_{i,t}}$ \ Control Variable & Var4 & $ln(X){i,t}$ \ & X & $\frac{X{i,t}} {X_{i,t}}$ \ & Var5 & $\frac{X_{i,t}}{X_{i,t}}$\ & Var6 & \begin{tabular}[c]{@{}l@{}}Text \ Text2\end{tabular} \ & Var7 & \begin{tabular}[c]{@{}l@{}}Text\ Text2\end{tabular} \ & Var8 & $\frac{X}{Y}$ \ & Var9 & $\frac{X}{Y}$ \ & Var10 & $\frac{X}{Y}$ \ & Var11 & Text \ \bottomrule \end{NiceTabular} \caption{CAPTION 1} \end{table} \end{document}

Output of the above code

F. Pantigny
  • 40,250