使用时multirow
,如何缩小两行之间的空间,同时仍保持所有内容垂直居中?以下是一个例子
\documentclass{article}
\usepackage{multirow}
% ---------------
\begin{document}
\begin{tabular}{l l}
some & text \\
& b \\[-4pt]
\multirow{-2}{*}{a}
& b \\
some & text \\
\end{tabular}
% ----------------
\begin{tabular}{l l}
some & text \\
& b \\
\multirow{-2}{*}{a}
& b \\
some & text \\
\end{tabular}
\end{document}
如果我缩小两个 b 之间的行间距,它就a
不再垂直居中了。
答案1
您不需要任何包来实现这一点,您只需嵌套即可tabular
。
\documentclass{article}
\begin{document}
\begin{tabular}{l l}
some & text \\
a & \begin{tabular}{@{}l}b \\[-4pt] b
\end{tabular}\\
some & text \\
\end{tabular}
\end{document}
比较:
\documentclass{article}
\usepackage{multirow}
% ---------------
\begin{document}
\begin{tabular}{l l}
some & text \\
a & \begin{tabular}{@{}l}b \\[-4pt] b
\end{tabular}\\
some & text \\
\end{tabular}
% ----------------
\begin{tabular}{l l}
some & text \\
& b \\[-4pt]
\multirow{-2}{*}{a}
& b \\
some & text \\
\end{tabular}
% ----------------
\begin{tabular}{l l}
some & text \\
& b \\
\multirow{-2}{*}{a}
& b \\
some & text \\
\end{tabular}
\end{document}