0

I am trying to make a table that is similar to this: The table as it should look like ...and failing. Here is my code:

\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}

Which creates this: The table as it looks now It's fairly close to what I want, but I can't find a way to make the horizontall lines appear wher they should. \hline creates lines that span the first row too.

Any help would be much appreciated.

GeMar
  • 1

1 Answers1

0

Just like @HeikoOberdiek said, \cline is the answer. Specifically for my needs,

    \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

Created exactly what I wanted.Thanks

GeMar
  • 1