首页 > 其他 > 详细

【650】LaTeX表格合并实现

时间:2021-08-30 06:15:18      阅读:21      评论:0      收藏:0      [点我收藏+]

LaTex制作表格之合并单元格

  在制作LaTex表格的时候,常常需要合并行和列,本文介绍的是使用 multirow 包里面的命令完成合并行列的方法。

\begin{table*}
%\usepackage{multirow}
\center
\begin{tabular}{|c|c|c|c|c|}
  \hline % horizontal line
  \multirow{2}{*}{1 \& 2} & \multicolumn{2}{l|}{ 3 \& 4 } & 5 & 6\\ %end line
  \cline{2-5} %short partial horizontal lines from column 2 to column 5
   & 7 & 8 & 9 & 10\\ %first cell is occupied by the multirow
  \hline
  \hline
  $ s_{1} $ & 2 & 3 & 4 & 5\  $ s_{2} $ & 2 & 3 & 4 & 5\  \hline
  \hline
  $ s_{3} $ & 2 & 3 & 4 & 5\\ 
  $ s_{4} $ & 2 & 3 & 4 & 5\  \hline
\end{tabular}
\end{table*}

  效果 

 

技术分享图片

 

\begin{table}[h]
    \caption{Optimization summary.}
    \label{tab:summary}
    \begin{tabular}{cccc}
        \toprule
        \multirow{2}{*}{Design} & \multicolumn{2}{c}{Problem size} & \multirow{2}{*}{CPU time(s)} \        \cline{2-3}
        & Binary variables & Constraints\        \midrule
        OM1 & 199 & 13,017 & 000 \        OM2 & 199 & 1,525 & 000 \        \bottomrule
    \end{tabular}
    \label{tab:my_label}
\end{table}

  效果

技术分享图片

【650】LaTeX表格合并实现

原文:https://www.cnblogs.com/alex-bn-lee/p/15200982.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!