表格行间距

表格行间距

首先是我创建表的代码:

\documentclass{report}
\usepackage{booktabs}
\usepackage{multirow}

\begin{document}

\begin{table}[!ht]
\begin{tabular}{lccc} 
 \textbf{Cases} & \textbf{First Order Condition} & \multicolumn{2}{c}{\textbf{Debt Level Chosen}} \\[5pt] \toprule

 \multirow{2}{*}{$b(1+r)\leq \tilde{b}$} & \multirow{2}{*}{$u'(1+b)=p-\frac{p b}{2 \epsilon_H}$} & $b^{G}$ & with $\tilde{b}>b^{G}$  \\[3pt]

 & & $\tilde{b}$ & with $\tilde{b}\leq b^{G}$ \\ [5pt] \midrule

$b(1+r)>\tilde{b}$ & $u'(1+b)=p$  & $b^{NG}$ & with $\tilde{b}<b^{NG}$  \\[5pt] \bottomrule
\end{tabular}
\caption{caption here}
\end{table}
\end{document}

对于间距,我在换行后使用了 ["any number"pt] 命令。它定义了特定行下方的空间。

是否可以定义行上方的空间?

例如,在后面放置 [pt] 命令\toprule可增加线条的粗细。我没有使用,\renewcommand{\arraystretch}{1.5}因为我不想论文中所有表格行的行距都相同。

答案1

由于你正在使用书签,您当然可以使用以下命令定义规则前后以及行之间的空间\addlinespace

\documentclass[12pt,a4paper,notitlepage]{report}
\usepackage{booktabs}
\usepackage{multirow}

\begin{document}
\begin{table}[!ht]
\centering
\begin{tabular}{lccc} 
\textbf{Cases} & \textbf{First Order Condition} & \multicolumn{2}{c}{\textbf{Debt Level Chosen}} \\ \toprule
\multirow{2}{*}{$b(1+r)\leq \tilde{b}$} & \multirow{2}{*}{$u'(1+b)=p-\frac{p b}{2 \epsilon_H}$}
  & $b^{G}$     & with $\tilde{b}>b^{G}$ \\
& & $\tilde{b}$ & with $\tilde{b}\leq b^{G}$ \\ \midrule
$b(1+r)>\tilde{b}$ & $u'(1+b)=p$  & $b^{NG}$ & with $\tilde{b}<b^{NG}$ \\ \bottomrule
\end{tabular}
\caption{Original}
\end{table}

\begin{table}[!ht]
\centering
\begin{tabular}{lccc} 
\textbf{Cases} & \textbf{First Order Condition} & \multicolumn{2}{c}{\textbf{Debt Level Chosen}} \\ \toprule
\multirow{2}{*}{$b(1+r)\leq \tilde{b}$} & \multirow{2}{*}{$u'(1+b)=p-\frac{p b}{2 \epsilon_H}$}
  & $b^{G}$     & with $\tilde{b}>b^{G}$ \\ \addlinespace[3em]
& & $\tilde{b}$ & with $\tilde{b}\leq b^{G}$ \\ \addlinespace[2em] \midrule \addlinespace[1em]
$b(1+r)>\tilde{b}$ & $u'(1+b)=p$  & $b^{NG}$ & with $\tilde{b}<b^{NG}$ \\ \bottomrule
\end{tabular}
\caption{Modified, 3em after first row, 2em before midrule, 1em after midrule}
\end{table}
\end{document}

在此处输入图片描述

相关内容