[Tex/LaTex] Longtable with multicolumn and parbox spacing issues

longtablemulticolumnspacingtables

I've been trying to build a "complex" table of a certain size but I still have some problems with the spacing. As you can see in the attached pictures, some lines overlap the table row dividers, other are just random (I suspect there is some conflict with the parbox function used inside the multicolumn one). Is there any way to have a more even and pleasant spacing?

First part of the table
enter image description here

\documentclass[]{article}
\usepackage{longtable}    
\begin{document}
\begin{longtable}{| p{3.5cm} | p{2.5cm} | p{3.5cm} | p{2.5cm} |}
\caption{Use case detail}\label{chap3:tab1}\\

\multicolumn{4}{c}{}\\
\endfirsthead
\multicolumn{4}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}}\\
\multicolumn{4}{c}{}\\
\hline
\endhead
\hline \multicolumn{4}{r}{\tablename\ \thetable\ -- \textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot

\hline
% --------------------------------------------------------------------------------------------------------------
Use Case ID: & \multicolumn{3}{l|}{1}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Use Case Name: & \multicolumn{3}{l|}{FIXME - Section Name}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Created by: & & Date created: &\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Actors & \multicolumn{3}{l|}{Doctor}\\
& \multicolumn{3}{l|}{Patient}\\
& \multicolumn{3}{l|}{Patients' Database}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Description: & \multicolumn{3}{l|}{\parbox{9cm}{The doctor logs into the system, creates/updates the patient medical record, prints the informed consent form and collects it after the patient has signed it.}}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Preconditions: & \multicolumn{3}{l|}{\parbox{9cm}{1. The doctor is logged into the web software.}}\\
& \multicolumn{3}{l|}{\parbox{9cm}{2. There is no record for the patient on the patients' database.}}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Postconditions: & \multicolumn{3}{l|}{ }\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Trigger: & \multicolumn{3}{l|}{\parbox{9cm}{The doctor logs in the system and presses the \textit{Login} button}}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Normal flow: & \multicolumn{3}{l|}{\parbox{9cm}{1. the doctor clicks on the \textit{Patients} icon;}}\\
& \multicolumn{3}{l|}{\parbox{9cm}{2. the doctor clicks on the \textit{Add} button;}}\\
& \multicolumn{3}{l|}{\parbox{9cm}{3. the doctor prints the consent form by clicking on the dedicated button;}}\\
& \multicolumn{3}{l|}{\parbox{9cm}{4. the doctor fills in the patient's details;}}\\
& \multicolumn{3}{l|}{\parbox{9cm}{5. the doctor collects the signed patient's consent form and ticks the dedicated check box;}}\\
& \multicolumn{3}{l|}{\parbox{9cm}{6. the doctor saves the patient's record by clicking the \textit{Save} button.}}\\
& \multicolumn{3}{l|}{\parbox{9cm}{}}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Alternative flows: & \multicolumn{3}{l|}{ }\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Exceptions: & \multicolumn{3}{l|}{ }\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Notes and issues: & \multicolumn{3}{l|}{ }\\
% --------------------------------------------------------------------------------------------------------------
\hline
\end{longtable}
\end{document}

Best Answer

I think you had too many columns and too much markup generally, I think I 'd do this unless you really need the lists to break over a page.

\documentclass{article}
\usepackage{longtable,array}
\setlength\extrarowheight{3pt}

\begin{document}

\begin{longtable}{| p{3.5cm} | p{9cm} |}
\caption{Use case detail}\label{chap3:tab1}\\[12pt]
\endfirsthead
\multicolumn{2}{c}{\tablename\ \thetable\ -- \textit{Continued from previous page}}\\[12pt]
\hline
\endhead
\hline
\multicolumn{2}{r}{\tablename\ \thetable\ -- \textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot

\hline
% --------------------------------------------------------------------------------------------------------------
Use Case ID: & 1\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Use Case Name: & FIXME - Section Name\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Created by:&\hspace{2cm}\vrule\ Date created:\hspace{2cm}\vrule\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Actors &
Doctor\newline
Patient\newline
Patients' Database\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Description: &
The doctor logs into the system, creates/updates the patient medical record, prints the informed consent form and collects it after the patient has signed it.\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Preconditions: &\mbox{}\par\vspace{-\baselineskip}
\begin{enumerate}
\item The doctor is logged into the web software.
\item There is no record for the patient on the patients' database.
\end{enumerate}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Postconditions: & \\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Trigger: & The doctor logs in the system and presses the \textit{Login} button\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Normal flow: &\mbox{}\par\vspace{-\baselineskip}
\begin{enumerate}
\item the doctor clicks on the \textit{Patients} icon;
\item the doctor clicks on the \textit{Add} button;
\item the doctor prints the consent form by clicking on the dedicated button;
\item the doctor fills in the patient's details;
\item the doctor collects the signed patient's consent form and ticks the dedicated check box;
\end{enumerate}\\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Alternative flows: & \\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Exceptions: & \\
% --------------------------------------------------------------------------------------------------------------
\hline
% --------------------------------------------------------------------------------------------------------------
Notes and issues: &\\
% --------------------------------------------------------------------------------------------------------------
\hline
\end{longtable}

\end{document}

enter image description here