我创建了一个表格,tabular
但文本似乎太靠近顶部边框。 有没有办法给表格单元格添加一些填充?
\begin{tabular}[t]{|l|l|l|l|}
\hline
\multicolumn{4}{|c|}{Content Words}\\
\hline
NOUNS & person & place & thing\\
\hline
VERBS & go & run & think \\
\hline
ADJECTIVES & good & bad & right \\
\hline
ADVERBS & very & almost & quite \\
\hline
\end{tabular}
如果您有任何建议,我将不胜感激。谢谢。
答案1
最简单的方法之一是加载包array
并调用
\renewcommand{\arraystretch}{<factor>}
将所有行的默认单元格间距增加factor
。
还有许多其他替代方法可以独立增加单元格上方和下方的空间、扩展单行等。
\documentclass{article}
\usepackage{array}% added <<<<<<<<<<<<<<<<<<
\begin{document}
\renewcommand{\arraystretch}{1.8}% added <<<<<<<<<<<<<<<<<<
\begin{tabular}[t]{|l|l|l|l|}
\hline
\multicolumn{4}{|c|}{Content Words}\\
\hline
NOUNS & person & place & thing\\
\hline
VERBS & go & run & think \\
\hline
ADJECTIVES & good & bad & right \\
\hline
ADVERBS & very & almost & quite \\
\hline
\end{tabular}
\end{document}
答案2
我认为,最简单的解决方案是使用cellspace
包,该包定义了用于在以字母为前缀的说明符的列中单元格顶部和底部实现最小垂直间距的工具S
(或者C
如果您加载siunitx
,或使用加载时间选项加载任何您想要的字母column= some letter
)。
具体过程如下:
\documentclass{article}
\usepackage{cellspace}
\setlength{\cellspacetoplimit}{6pt}
\setlength{\cellspacebottomlimit}{6pt}
\begin{document}
\begin{tabular}[t]{|Sl|l|l|l|}
\hline
\multicolumn{4}{|Sc|}{Content Words}\\
\hline
NOUNS & person & place & thing\\
\hline
VERBS & go & run & think \\
\hline
ADJECTIVES & good & bad & right \\
\hline
ADVERBS & very & almost & quite \\
\hline
\end{tabular}
\end{document}