赞
踩
LaTeX 表格里的内容太长想换行怎么办
目录
主要有两个步骤:
1、添加下面这行命令
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
2、将需要换行的内容放到下面的语句中,并用 \\ 换行
\tabincell{c}{ }
- \begin{table}[htbp]
- % 添加下面的命令
- \newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
-
- \centering
- \caption{Add caption}
- \begin{tabular}{cc}
- \toprule
- \multicolumn{1}{l}{Data Name} & \multicolumn{1}{l}{NO1} \\
- \midrule
-
- % 在合并的单元格内换行
- \multirow{2}[3]{*}{\tabincell{c}{Left hand\\Rigth hand}} & 12346 \\
-
- % 在普通单元格内换行
- \cmidrule{2-2} & \tabincell{c}{WERTYOPASDF\\1234} \\
-
- \bottomrule
- \end{tabular}%
- \end{table}%

效果如下
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。