分享一个增加表格中某一行高度的Latex代码. 该代码来自此处.
\documentclass{article}
\usepackage{stackengine}
\newcommand\xrowht[2][0]{\addstackgap[.5\dimexpr#2\relax]{\vphantom{#1}}}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{|c|l|}
\hline
col1 & col2 \\
\hline\xrowht[()]{10pt}
1 & 2g \\
\hline\xrowht{20pt}
3 & 4 \\
\hline\xrowht{30pt}
5 & 6 \\
\hline\xrowht{40pt}
7 & 8 \\
\hline
\end{tabular}
\end{table}
\end{document}
其执行结果如下:
以上代码中, \newcommand的用法可参见此处.