我想在下表的单元格之间添加更多空间。我尝试了[2ex]
后面的命令\\
,但这会改变垂直对齐方式,而我希望垂直对齐方式居中。
\documentclass{article}
\begin{document}
\begin{table}
\footnotesize
\centering
\begin{tabular}{c|c|c|c}
\multicolumn{4}{c}{ } \\
Text text text text & Text text text text & Text text text text & Text text text text \\\hline
\multirow{2}{*}{Text text text}
& Text text text text & Text text text text & Text text text text \\[2ex]
& Text text text text & Text text text text & Text text text text \\[2ex]\hline
\multirow{2}{*}{Text text text}
& Text text text text & Text text text text & Text text text text \\[2ex]
& Text text text text & Text text text text & Text text text text \\[2ex]\hline
\end{tabular}
\end{table}
\end{document}
答案1
以下简单示例展示了根据您的意图的几种替代方案:
\documentclass{article}
\begin{document}
\noindent Default settings:\\
\begin{tabular}{ccc}
\hline
column1a & column2a & column3a \\
\hline
column1b & column2b & column3b \\
\hline
\end{tabular}
\vspace{36pt}
\noindent Changing \verb+\tabcolsep+ (default value: \texttt{6pt}):\\
{
\addtolength\tabcolsep{10pt}
\begin{tabular}{ccc}
\hline
column1a & column2a & column3a \\
\hline
column1b & column2b & column3b \\
\hline
\end{tabular}
}
\vspace{36pt}
\noindent Using the \verb+@{...}+ syntax to add space individually:\\
\begin{tabular}{c@{\hspace{25pt}}cc}
\hline
column1a & column2a & column3a \\
\hline
column1b & column2b & column3b \\
\hline
\end{tabular}
\vspace{36pt}
\noindent Changing \verb+\arraystretch+ factor:\\
{
\renewcommand\arraystretch{1.4}
\begin{tabular}{c@{\hspace{25pt}}cc}
\hline
column1a & column2a & column3a \\
\hline
column1b & column2b & column3b \\
\hline
\end{tabular}
}
\vspace{36pt}
\noindent Using the optional argument for \verb+\\+ in a \textit{per-row} basis:\\
\begin{tabular}{c@{\hspace{25pt}}cc}
\hline
column1a & column2a & column3a \\[2ex]
\hline
column1b & column2b & column3b \\
\hline
\end{tabular}
\end{document}
答案2
写在之前\begin{tabular}
\addtolength\tabcolsep{5pt}
答案3
如果您能够承受环境变化,请在文档开头指定 和 而tabu
不是。对和使用相同的值以保持垂直对齐。tabular
\tabulinesep=^Xmm_Ymm
X
Y