1

I want to use horizontal line for the first two column. See my picture for details.

enter image description here

\documentclass[12pt,letterpaper]{article}    
\usepackage[left=20mm,top=30mm,bottom=30mm,right=20mm]{geometry}

\begin{document} \begin{table} \centering \resizebox{0.7\columnwidth }{!}{%

\begin{tabular}{ |p{5cm}|p{5cm}|p{6cm}| } \hline

\hline \textbf{Portion of Scenario} & \textbf{Description} & \textbf{Possible Values} \ \hline Sources & This specify where the fault comes from & Internal/external: people, hardware, software, physical infrastructure, physical environment\ \hline Stimulus & The stimulus to an availability scenario is a fault. & Fault: omission, crash, incorrect timing, incorrect response \ \hline Artifact & This specifies which portions of the system are responsible for and affected by the fault.& Processors, communication channels, storage, processes, affected artifacts in the system's environment \ \hline Environment &We may be interested in not only how a system behaves in its "normal" environment, but also how it behaves in situations such as when it is already recovering from a fault. & Normal operation, startup, shutdown, repair mode, degraded operation, overloaded operation \ \hline Response & The most commonly desired response is to prevent the fault from becoming a failure, but other responses may also be important, such as notifying people or logging the fault for later analysis. This section specifies the desired system response. & Prevent the fault from becoming a failure \newline Detect the fault: \begin{itemize} \item Log the fault \item Notify the appropriate entities (people or systems) \item Recover from the fault \item Disable the source of events causing the fault \item Be temporarily unavailable while a repair is being effected \item Fix or mask the fault/failure or contain the damage it causes \item Operate in a degraded mode while a repair is being effected \item Time or time interval when the system must be available \item Availability percentage (e.g., 99.999 percent) \item Time to detect the fault \item Time to repair the fault \item Time or time interval in which system can be in degraded mode \item Proportion (e.g., 99 percent) or rate (e.g., up to 100 per second) of a certain class of faults that the system prevents, or handles without failing \end{itemize} \ Response measure & We may focus on a number of measures of availability, depending on the criticality of the service being provided. \ \hline \end{tabular} } \end{table}

\end{document}

kile
  • 655
  • 3
    Without really looking at your code: \cline{1-2} draws a horizontal line only in the first and second column. – Skillmon Feb 15 '23 at 11:53
  • @Skillmon Thank you. How about the missing right bottom vertical line which is missing? – kile Feb 15 '23 at 12:23
  • @kile - Add & after of the service being provided. and before \\. – Mico Feb 15 '23 at 12:32
  • 1
    Off-topic: left=20mm,top=30mm,bottom=30mm,right=20mm may be expressed more succinctly as hmargin=20mm, vmargin=30mm. – Mico Feb 15 '23 at 12:34

2 Answers2

2

I think the main issue with your table is that the font is very small due to the \resizebox instruction. It looks like you've inserted the \resizebox instruction in order to make the table fit on a single page.

I would like to recommend a different approach to making the table fit on the page: Use a tabularx environment, let the three columns have different widths, and use the machinery of the enumitem package to make the itemize environment in the third column take up a lot less space.

enter image description here

\documentclass[12pt,letterpaper]{article}    
\usepackage[hmargin=20mm, vmargin=30mm]{geometry}

% new code: \usepackage{enumitem} \usepackage{tabularx,ragged2e} % See section 4.3, "column widths", of user guide of 'tabularx' package: \newcolumntype{L}[1]{>{\RaggedRight\hsize=#1\hsize\linewidth=\hsize}X}

\begin{document}

\begin{table}[p!] \small % for a 10% linear font size reduction \begin{tabularx}{\textwidth}{ |L{0.45}|L{0.9}|L{1.65}| } \hline \textbf{Portion of Scenario} & \textbf{Description} & \textbf{Possible Values} \ \hline Sources & This specifies where the fault comes from. & Internal/external: people, hardware, software, physical infrastructure, physical environment \ \hline Stimulus & The stimulus to an availability scenario is a fault. & Fault: omission, crash, incorrect timing, incorrect response \ \hline Artifact & This specifies which portions of the system are responsible for and affected by the fault. & Processors, communication channels, storage, processes, affected artifacts in the system's environment \ \hline Environment & We may be interested in not only how a system behaves in its ``normal'' environment, but also how it behaves in situations such as when it is already recovering from a fault. & Normal operation, startup, shutdown, repair mode, degraded operation, overloaded operation \ \hline Response & The most commonly desired response is to prevent the fault from becoming a failure, but other responses may also be important, such as notifying people or logging the fault for later analysis. This section specifies the desired system response. & Prevent the fault from becoming a failure. \newline Detect the fault: \begin{itemize}[nosep, left=0pt] \item Log the fault \item Notify the appropriate entities (people or systems) \item Recover from the fault \item Disable the source of events causing the fault \item Be temporarily unavailable while a repair is being effected \item Fix or mask the fault/failure or contain the damage it causes \item Operate in a degraded mode while a repair is being effected \item Time or time interval when the system must be available \item Availability percentage (e.g., 99.999 percent) \item Time to detect the fault \item Time to repair the fault \item Time or time interval in which system can be in degraded mode \item Proportion (e.g., 99 percent) or rate (e.g., up to 100 per second) of a certain class of faults that the system prevents, or handles without failing. \end{itemize} \ \cline{1-2} Response measure & We may focus on a number of measures of availability, depending on the criticality of the service being provided. & \ \hline \end{tabularx} \end{table}

\end{document}

Mico
  • 506,678
2

With tabularray and the library varwidth section 5.8 in the documentation, i replaced \resizebox with sriptsize \resizebox doesn't seem like a good idea. see this post tex.stackexchange.com/questions/425453/… and Using adjustbox withouth changing fontsize

EDIT: with Mico's recommendations, and the idea of ​​setting up the itemize environment with the enumitem package

The code

\documentclass[12pt,letterpaper]{article}
%\usepackage[left=20mm,top=30mm,bottom=30mm,right=20mm]{geometry}
\usepackage[hmargin=20mm, vmargin=30mm]{geometry}%<-- Mico's comment
\usepackage{tabularray,varwidth,enumitem}%<-- package enimitem
\pagestyle{empty}
\begin{document}
%\begin{scriptsize}%<-- Mico's explanation
{\scriptsize
\begin{tblr}{
    colspec = {*{2}{Q[wd=5cm]} Q[wd=6cm]},
    row{1} = {font=\bfseries},
    vlines,
}
\hline
Portion of Scenario & Description & Possible Values \\
\hline
Sources & This specify where the fault comes from & Internal/external: people, hardware, software, physical infrastructure, physical environment\\
\hline
Stimulus & The stimulus to an availability scenario is a fault.   & Fault: omission, crash, incorrect timing, incorrect response \\
\hline
Artifact & This specifies which portions of the system are responsible for and affected by the fault.& Processors, communication channels, storage, processes, affected artifacts in the system's
environment \\
\hline
Environment    &We may be interested in not only how a system behaves in its "normal" environment, but also how it behaves in situations such as when it is already recovering from a fault. & Normal operation, startup, shutdown, repair mode, degraded operation, overloaded operation \\
\hline
Response & The most commonly desired response is to prevent the fault from becoming a failure, but other responses may also be important, such as notifying people or logging the fault for later analysis. This section specifies the desired system response. & Prevent the fault from becoming a failure
\newline
Detect the fault:
\begin{itemize}[nosep, left=0pt]
\item Log the fault
\item Notify the appropriate entities (people or systems)
\item Recover from the fault
\item Disable the source of events causing the fault
\item Be temporarily unavailable while a repair is
being effected
\item Fix or mask the fault/failure or contain the damage it causes
\item Operate in a degraded mode while a repair is
being effected
\item Time or time interval when the system must be available
\item Availability percentage (e.g., 99.999 percent)
\item Time to detect the fault
\item Time to repair the fault
\item Time or time interval in which system can be in degraded mode
\item Proportion (e.g., 99 percent) or rate (e.g., up to 100 per second) of a certain class of faults that the system prevents, or handles without failing 
\end{itemize}
\\
\cline{1-2}
Response measure & We may focus on a number of measures of availability, depending on the criticality of the service being provided.  \\
\hline
\end{tblr}
}%<-- end of scriptsize
%\end{scriptsize}%
\end{document}

enter image description here

pascal974
  • 4,652
  • \scriptsize is a directive, not an environment. – Mico Feb 15 '23 at 15:42
  • @Mico {\scriptsize a piece of text} (variant: \begin{scriptsize} several lines of text \end{scriptsize}), isn't that correct? – pascal974 Feb 16 '23 at 03:50
  • 1
    The "variant" code snippet happens to compile. However, this does not imply that LaTeX has defined an environment called scriptsize. When an environment called foo is defined, LaTeX creates 2 macros -- \foo and \endfoo -- in the background; these get executed when \begin{foo} and \end{foo} are encountered in the document. When LaTeX encounters \begin{scriptsize}, it actually executes \scriptsize; this, happily, works. \endscriptsize does not exist; however, LaTeX ignores certain (but not all) undefined macros. The variant code snippet "works", but it's purely by luck. ... – Mico Feb 16 '23 at 04:44
  • 1
    (continued) ... Take an environment that really exists, say, math. Both uuu \begin{math} uuu \end{math} uuu and uuu \math uuu \endmath\ uuu work, i.e., both code snippets produce the same output without throwing errors. If scriptsize really were a predefined LaTeX environment, aaa \scriptsize aaa \endscriptsize aaa should work too; however, it does not. (Don't believe me? Then run the code snippet.) I think it's good practice to stick to the well-defined code and not rely on a "variant" that just happens to "work" out of sheer luck... – Mico Feb 16 '23 at 04:50
  • 1
    @Mico Thank you very much for your explanation, I modified my answer – pascal974 Feb 16 '23 at 05:27