Latex 的Table使用multirow and multicolumn

Latex 的Table使用multirow and multicolumn

Here are some tips:

  • Use a \multicolumn{1}{|l}{} & \multicolumn{2}{l|}{...} construct;
  • Add another \multicolumn{2}{c|}{} to the second row; and
  • Use an additional \cline{1-1} to insert a rule between elements in the first column.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
\documentclass[a4paper,12pt]{report}
\usepackage[inner=0.75in,outer=0.65in,top=0.75in,bottom=0.75in]{geometry}
\usepackage[sc]{mathpazo}
\usepackage{multirow}
\begin{document}
\begin{table}[!htb]
  \centering
  \caption{Present Strength-Production}
  \begin{tabular}{|c|l|l|c|c|c|c|c|c|}
    \hline
    \multirow{2}{*}{Sl.No} &
    \multicolumn{2}{c|}{\multirow{2}{*}{\textbf{Designation}}} &
    \multicolumn{4}{c|}{\textbf{Shifts}} & \textbf{Leave/Off} &
    \multirow{2}{*}{\textbf{Total}} \\
    \cline{4-7}
    & \multicolumn{2}{c|}{} & \textbf{A} & \textbf{B} & \textbf{C} & \textbf{G} & \textbf{Reserve} & \\
    \hline
    1 & \multicolumn{2}{l|}{Plant Engineer} & & & & 1 & & 1 \\
    \hline
    \multicolumn{1}{|l}{} & \multicolumn{2}{l|}{\textbf{Sub Total}} & & & & \textbf{1} & & \textbf{1} \\
    \hline
    2 & \multirow{2}{*}{Operator}&Work related to water regeneration & 1 & 1 & 1 & & 1 & 4 \\
    \cline{1-1}\cline{3-9}
    3 & & Work related to valve control & 1 & 1 & 1 & & 1 & 4 \\
    \hline
    \multicolumn{1}{|l}{} & \multicolumn{2}{l|}{\textbf{Sub Total}} & \textbf{2} & \textbf{2} & \textbf{2} & & \textbf{2} & \textbf{8} \\
    \hline
    1 & \multicolumn{2}{l|}{Worker} & 2 & 2 & 2 & & 2 & 8 \\
    \hline
    \multicolumn{1}{|l}{} & \multicolumn{2}{l|}{\textbf{Sub Total}} & \textbf{2} & \textbf{2} & \textbf{2} & & \textbf{2} & \textbf{8} \\
    \hline \hline
    \multicolumn{1}{|l}{} & \multicolumn{2}{l|}{\textbf{Total}} & \textbf{4} & \textbf{4} & \textbf{4}
    & \textbf{1} & \textbf{4} & \textbf{17} \\
    \hline
  \end{tabular}
  \label{tab:pro_pro}
\end{table}
\end{document}
posted @   菜鸡一枚  阅读(10457)  评论(1编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2015-08-21 统计学习那些事
2015-08-21 Image Scaling using Deep Convolutional Neural Networks
2015-08-21 Unsupervised learning, attention, and other mysteries
2015-08-21 How To Build Compelling Stories From Your Data Sets
2015-08-21 你应该掌握的七种回归技术
点击右上角即可分享
微信分享提示