在 tabu 表中,如果单元格中的文本足够长,则会自动插入换行符。这对我来说没问题,也是我想要的。但是,该单元格中的最后一行文本基本上与下一个 \hline 底部对齐,即没有填充。
这是预期行为还是错误?我该如何修复它?
示例代码:
\documentclass{scrartcl}
\usepackage{tabu}
\begin{document}
\begin{tabu} to \textwidth {|X|X|X|X|}
\hline
Column 1&Column 2&Column 3&Column 4\\
\hline
some text&some long text some long text some long text some long text &some text&some text\\
\hline
some text&no problem here&some text&some text\\
\hline
\end{tabu}
\end{document}
答案1
像这样?
tabu
在表格之前的某处添加\tabulinesep=<amount>
:
\documentclass{scrartcl}
\usepackage{tabu}
\begin{document}
\tabulinesep = 3pt % <--- added
\begin{tabu} to \textwidth {|X|X|X|X|}
\hline
Column 1&Column 2&Column 3&Column 4\\
\hline
some text&some long text some long text some long text some long text &some text&some text\\
\hline
some text&no problem here&some text&some text\\
\hline
\end{tabu}
\end{document}