问题:想要实现LaTeX表格合并行,效果如下图
方法:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{ccc}
\hline
\multirow{2}{*}{5${\times}$}
conv dw/s1&3${\times}$3${\times}$512 dw & 14${\times}$14${\times}$512 \\
conv/s1&1${\times}$1${\times}$512${\times}$512& 14${\times}$14${\times}$512 \\
\hline
\end{tabular}
\end{center}
\end{table}
注意:在使用\multirow这个命令时必须要引入它的宏包。也就是必须要在导言区增加如下的代码:\usepackage{multirow}这个代码。导言区,就是文档最开头的位置,在\documnetclass{} 下面,\begin{document}前面的位置。
若在Linux下的TeXstudio中使用\usepackage{multirow}报错,提示multirow.sty not found。这是因为在Latex保存sty文件的目录下,没有找到multirow.sty文件。可能是TexLive没带该Package。只要再安装texlive-latex-extra即可。
Ubuntu中使用以下命令可以安装:
sudo apt-get install texlive-latex-extra