某些表格单元格中出现水平线

某些表格单元格中出现水平线

我正在尝试制作一个与此类似的表格: 表格应如下所示 ...失败了。这是我的代码:

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{multirow}

\begin{document}
\begin{table}[h]
\caption{This is a caption}
\centering % centering table
\begin{tabular}{|l| p{5cm} | p{5cm} | c|} 
\hline
 Domain & Sub-domain & Use case &Suitable \\
\hline % inserts single-line
Metering & Water, Electricity or Gas distribution & Collect daily or bi-             hourly water, electricity and gas usage data. & Yes \\
\hline
\multirow{9}{2cm}{Infrastructure networks} & Water \& Gas transportation &      Water and Gas infrastructure network surveillance (alarm,
metering parameters) & Yes\\ 

& Power Grid & Electricity transport status monitoring and
command/control & Yes \\ 
& Power Grid & Command and control & Yes \\ 
& Traffic monitoring & Traffic light functionality monitoring, traffic level      monitoring, & Yes \\
& Traffic shaping & emergency gate status control, traffic lights control &     Potentially \\
\hline

\multirow{7}{3cm}{Environmental \& Smart City} & Pipelines & Collect data on     Metrics (temperature, pressure), alarms, leakage, vibration & yes \\
& Waste and Drains management               & Collect data on levels                                            & yes \\
& Atmospheric Noise-Pollution monitoring    & Collect data on humidity,     noise, temperature,$CO_2$,CO, etc. & yes \\
& Public Lighting Monitoring & Bulb monitoring & yes \\
& Parking management & Availability monitoring & yes \\
\hline

\end{tabular}
\end{table}
\end{document}

这就产生了: 现在的表格 它非常接近我想要的,但我找不到让水平线出现在应有位置的方法。 \hline 也会创建跨越第一行的线。

任何帮助将非常感激。

答案1

就像@HeikoOberdiek 所说的那样,\cline 就是答案。具体来说,对于我的需求,

    \multirow{9}{2cm}{Infrastructure networks} & Water \& Gas transportation &     Water and Gas infrastructure network surveillance (alarm,
metering parameters) & Yes\\ 
\cline{2-4}
& Power Grid & Electricity transport status monitoring and
command/control & Yes \\ 
\cline{2-4}
& Power Grid & Command and control & Yes \\ 
\cline{2-4}
& Traffic monitoring & Traffic light functionality monitoring, traffic level     monitoring, & Yes \\
\cline{2-4} 
& Traffic shaping & emergency gate status control, traffic lights control &     Potentially \\
\hline

正是我想要的。谢谢

相关内容