在乳胶中的表格单元格中创建水平线

在乳胶中的表格单元格中创建水平线

所以基本上我想知道如何让下面的表格在预先存在的行中为每个“换行符”从控制列到对齐列有一条线。

如果它适用于长桌并且很简单,则可以获得额外的加分!

\setlength\LTleft{-2cm}
\setlength\LTright{-2cm}
\begin{tabular}
{ | p{1cm} | p{2cm} | p{1cm} | p{4cm} | p{0.5cm} | p{1cm} | p{1cm} | p{1.5cm} | p{1.5cm} | } 
\hline
Risk Tag & Risk & Risk Severity & Control & Cost & Benefit & Chosen & Residual Risk & Justification \\
\hline
R01 & Eavesdropping on local network & Critical & Prevent C1 - Patch wireless router - if patch available \newline  Prevent C2 - Use https everywhere browser plugin where available & L & H & Y & L & Free and Effective\\
\hline
R02 & MITM on local network & High\\
\hline
R03 & Infection of Phones via Exploit & High \\
\hline
\hline
 \end{tabular}

这是图片,如果可能的话,我希望两者之间的线可以阻止

这是图片,如果可能的话,我希望两者之间的线可以阻止

答案1

如果您将第二个“防止”放在单独的行中,则可以\cline按照注释中的建议使用。\multirow不过,您可能需要“窃听”单元格。

代码输出

\documentclass{article}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{geometry}
\geometry{margin=1cm}
\begin{document}
{\small
\begin{longtable}
{ | p{1cm} | p{2cm} | p{1cm} | p{4cm} | p{0.5cm} | p{1cm} | p{1cm} | p{1.5cm} | p{1.5cm} | } 
\hline
Risk Tag & Risk & Risk Severity & Control & Cost & Benefit & Chosen & Residual Risk & Justification \\
\hline
R01 & \multirow{2}{*}{\parbox[t]{2cm}{Eavesdropping on local network}} & Critical & Prevent C1 -- Patch wireless router -- if patch available & L & H & Y & L & Free and Effective\\ \cline{4-9}
 &  & & Prevent C2 - Use https everywhere browser plugin where available &&&&& \\ 
\hline
R02 & MITM on local network & High\\
\hline
R03 & Infection of Phones via Exploit & High \\
\hline
\hline
\end{longtable}}
\end{document}

相关内容