- 合并1行多列可以使用
\multicolumn{cols}{pos}{text}
来实现
\documentclass[a4paper,12pt]{report}
\usepackage[UTF8,nopunct]{ctex}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{合并一行两列} & 三 & 四 \\
\hline
1 & 2 & 3 & 4 \\
\hline
\end{tabular}
\end{table}
\end{document}
合并多行一列单元格
- 合并多行1列单元格可以用
multirow
包中的\multirow{rows}{width}{text}
来实现 - 注意这里的第2个参数是
{width}
,与\multicolumn
第2个参数不同。如果不确定{width}
需要填什么,就将其替换为*
,如代码中所示