Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[11pt]{article}
- usepackage{multirow}
- usepackage[table]{xcolor}
- begin{document}
- begin{center}
- begin{table}[!htbp]
- noindent
- begin{tabular}{|c|p{3cm}|p{3cm}|p{3cm}|}
- hline
- multirow{2}{3cm}{centering cellcolor{gray!50} Effectiveness of Controls} & multicolumn{3}{p{9cm}|}{centering cellcolor{gray!50} Probability of Threat Occurrence (Natural or Environmental Threats) or Threat Motivation and Capability (Human Threats)} \
- cline{2-4}
- rowcolor{gray!50}
- & Low & Moderate & High \
- hline
- rowcolor{white!50}
- cellcolor{gray!50} Low & Moderate & High & High \
- hline
- rowcolor{white!50}
- cellcolor{gray!50} Moderate & Low & Moderate & High \
- hline
- rowcolor{white!50}
- cellcolor{gray!50} High & Low & Low & Moderate \
- hline
- end{tabular}
- caption{Risk Classifications}
- label{tab:xyz}
- end{table}
- end{center}
- end{document}
- multirow{2}{dimexpr0.25textwidth-2arrayrulewidth-2tabcolseprelax}[-0.5cm]{...
- documentclass[11pt,draft]{article}
- usepackage{multirow}
- usepackage[table]{xcolor}
- usepackage{array}
- newcolumntype{C}[1]{>{centeringarraybackslash}p{#1}}
- begin{document}
- begin{center}
- begin{table}[!htbp]
- noindent
- begin{tabular}{|c|C{dimexpr0.25textwidth-arrayrulewidth-2tabcolseprelax}
- |C{dimexpr0.25textwidth-arrayrulewidth-2tabcolseprelax}
- |C{dimexpr0.25textwidth-arrayrulewidth-2tabcolseprelax}|}
- hline
- multirow{2}{dimexpr0.25textwidth-2arrayrulewidth-2tabcolseprelax}[-0.5cm]{centering cellcolor{gray!50} Effectiveness of Controls} & multicolumn{3}{p{dimexpr 0.75textwidth-arrayrulewidth-2tabcolseprelax}|}{cellcolor{gray!50}centering Probability of Threat Occurrence (Natural or Environmental Threats) or Threat Motivation and Capability (Human Threats)} \
- cline{2-4}
- cellcolor{gray!50}
- & cellcolor{gray!50} Low & cellcolor{gray!50} Moderate & cellcolor{gray!50} High \
- hline
- %rowcolor{white!50}
- cellcolor{gray!50} Low & Moderate & High & High \
- hline
- rowcolor{white!50}
- cellcolor{gray!50} Moderate & Low & Moderate & High \
- hline
- rowcolor{white!50}
- cellcolor{gray!50} High & Low & Low & Moderate \
- hline
- end{tabular}
- caption{Risk Classifications}
- label{tab:xyz}
- end{table}
- end{center}
- end{document}
- documentclass{article}
- usepackage{cals, caption, xcolor}
- letnc=nullcell % CALS Shortcuts for spanning cells
- letsc=spancontent
- begin{document}
- begin{table}[!htbp]
- begin{calstable}[c] % Centred CALS tabular
- % Calculate the column width
- colwidths{{dimexpr(columnwidth)/4relax}
- {dimexpr(columnwidth)/4relax}
- {dimexpr(columnwidth)/4relax}
- {dimexpr(columnwidth)/4relax}
- }
- % The tabular fills the text area if sum of all columns is 4
- % Set up the tabular
- makeatletter
- defcals@framers@width{0.4pt} % Outside horizontal frame rules
- defcals@framecs@width{0,4pt} % Outside vertical frame rules
- defcals@bodyrs@width{0.4pt} % Rule between header and tabular body
- defcals@cs@width{0.4pt} % Inside vertical rules
- defcals@rs@width{0.4pt} % Inside horizontal rules
- defcals@bgcolor{} % To avoid undefined
- defgray{ifxcals@bgcolorempty % "Switch" to turn on and off colour
- defcals@bgcolor{gray!30}
- else defcals@bgcolor{} fi}
- % R1H1 % Just a comment: Row one, header row one
- thead{
- brow
- grayalignCnc{lrt} % Switch to gray background and centred text, works until switched off
- nc{ltb}
- nc{tb}
- nc{rtb}sc{vfil Probability of Threat Occurrence (Natural or Environmental Threats)}
- erow
- %R2H2 % Row two, header row two
- brow
- nc{lrb}sc{vfil Effectiveness of Controls} % "vfil" centres the cell content vertically
- cell{vfil Low}
- cell{vfil Moderate}
- cell{vfil High}gray % Always reset colour at end of header
- erow
- %R3B1 % Row three, body row one
- brow
- graycell{Low}gray % Switch to gray background for first cell (column 1)
- cell{vfil Moderate}
- cell{vfil High}
- cell{vfil High}
- erow
- %R4B2
- brow
- graycell{Moderate}gray
- cell{vfil Low}
- cell{vfil Moderate}
- cell{vfil High}
- erow
- %R5B3
- brow
- graycell{High}gray
- cell{vfil Low}
- cell{vfil Low}
- cell{vfil Moderate}
- erow
- makeatletter
- end{calstable}par
- caption{Risk Classifications}
- label{tab:xyz}
- end{table}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement