1

this is my bit of latex:

\begin{tabular}{ |p{1cm}|p{3cm}|p{8cm}| }
 \hline
\multicolumn{3}{|c|}{\textbf{Information Asset Risk Worksheet}} \\
 \hline 
\multicolumn{3}{|l|}{Information Asset: (hier typen)} \\
 \hline 
 \multicolumn{3}{|l|}{Area of Concern: (hier typen)} \\
 \hline 

  \multirow{6}{*}{\textbf{Threat}} & \textbf{(1)Actor} & ...\\ 
    & \textbf{(2)Means} & ...\\ 
   &  \textbf{(Motive)} & ...\\ 
    &  \textbf{(4)Outcome} & ...\\  
    &  \textbf{(5) Security Requirements} & ...\\ 
    &  \textbf{(6)Probability} & ...\\ \hline

\end{tabular}

and this is the result:

enter image description here

I either get hlines everywhere even though I use \multirow or I get no hlines at all. How do I get hlines after the combined "threat" multirow?

KR

1
  • by use of \cline{2-3} ... welcome to tex.se!
    – Zarko
    Feb 26, 2018 at 11:45

2 Answers 2

1

like this?

enter image description here

than you look for \cline{2-3} which draw horizontal lines only in second and third column (and not have problems with vertical ones, or i misunderstood your question):

\documentclass{article}
\usepackage{array, multirow}

\begin{document}
{\renewcommand\arraystretch{1.3}
\begin{tabular}{ |p{1.5cm}|>{\bfseries\raggedright}p{2.75cm}|p{7.75cm}| }
    \hline
\multicolumn{3}{|c|}{\textbf{Information Asset Risk Worksheet}} \\
    \hline
\multicolumn{3}{|l|}{Information Asset: (hier typen)} \\
    \hline
\multicolumn{3}{|l|}{Area of Concern: (hier typen)} \\
    \hline
\multirow{6}{=}{\textbf{Threat}}
    &   (1) Actor                   & ...   \\
    \cline{2-3}
    &   (2) Means                   & ...   \\
    \cline{2-3}
    &   (3) Motive)                 & ...   \\
    \cline{2-3}
    &   (4) Outcome                 & ...   \\
    \cline{2-3}
    &   (5) Security Requirements   & ...   \\
    \cline{2-3}
    &   (6) Probability             & ...   \\
    \hline
\end{tabular}
}
\end{document}

i also slightly simplify the table code.

0
1

TeXnician's answer has a little flaw, the word "Threat" is not perfectly vertically aligned, you can easily see it if you create a cell with more than one line of text (see the first table below).

To avoid it, I suggest to you to create the main table with a row which consists of a cell with the word "Threat" and another cell with a "subtable" with the rest of the main table. This way there are no alignment problems (see the second table below).

\documentclass[a4paper]{article}
\usepackage[lmargin=3cm]{geometry}%only to avoid overfull hbox in my mwe, since your mwe is not complete we don't know the exact geometry of your document

\usepackage{array, multirow}
\renewcommand\arraystretch{1.3}
\newcolumntype{B}[1]{>{\bfseries\raggedright}p{#1}}
\newcolumntype{L}[1]{>{\bfseries\raggedright}m{#1}}

\begin{document}
\TeX{}nician's answer:
\begin{center}
\begin{tabular}{ |p{1.5cm}|>{\bfseries\raggedright}p{2.75cm}|p{7.75cm}| }
    \hline
\multicolumn{3}{|c|}{\textbf{Information Asset Risk Worksheet}} \\
    \hline
\multicolumn{3}{|l|}{Information Asset: (hier typen)} \\
    \hline
\multicolumn{3}{|l|}{Area of Concern: (hier typen)} \\
    \hline
\multirow{6}{=}{\textbf{Threat}}
    &   (1) Actor                   
        & In \TeX{}nician's answer the word \textbf{Threat} is not perfectly 
          vertically aligned, you can easily see it if you create a cell with
          more than one line of text\\
    \cline{2-3}
    &   (2) Means                   & ...   \\
    \cline{2-3}
    &   (3) Motive                & ...   \\
    \cline{2-3}
    &   (4) Outcome                 & ...   \\
    \cline{2-3}
    &   (5) Security Requirements   & ...   \\
    \cline{2-3}
    &   (6) Probability             & ...   \\
    \hline
\end{tabular}
\end{center}

My suggestion:
\begin{center}
\begin{tabular}{ |m{1.5cm}|m{2.75cm}|m{7.75cm}| }
    \hline
    \multicolumn{3}{|c|}{\textbf{Information Asset Risk Worksheet}} \\
    \hline
    \multicolumn{3}{|l|}{Information Asset: (hier typen)} \\
    \hline
    \multicolumn{3}{|l|}{Area of Concern: (hier typen)} \\
    \hline
    \textbf{Threat}
        & \multicolumn{2}{@{}c@{}}{% a "sub"-table
            \begin{tabular}{B{2.75cm}|p{7.75cm}|}
                (1) Actor                   
                    & With my solution the word \textbf{Threat} is always 
                      perfectly aligned, whatever is the content of the other 
                      cells\\
                \hline
                (2) Means & ...   \\
                \hline
                (3) Motive                & ...   \\
                \hline
                (4) Outcome                 & ...   \\
                \hline
                (5) Security Requirements   & ...   \\
                \hline
                (6) Probability             & ...   \\
            \end{tabular}% end of the sub-table
          }% end of the \multicolumn
        \\% end of row with "Threat" and the sub-table
    \hline
\end{tabular}
\end{center}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .