如何使列标题上方出现垂直多列标题

如何使列标题上方出现垂直多列标题

如何使列标题上方有垂直多列标题?即类似于下图?

在此处输入图片描述

答案1

您可以创建新标签(此处\rotLabel:)并定义一个角度(此处45:)以使用 来定位标签\rotatebox。用于\raisebox{0pt}[0pt][0pt]列宽。

绘制纯色圆圈:\newcommand{\filledcirc}{${\color{black}\bullet}\mathllap{\circ}$} 或不绘制彩色圆圈:\newcommand{\normalcirc}{${\color{white}\bullet}\mathllap{\circ}$}

在此处输入图片描述

\documentclass{article}

\newcommand*{\zerobox}[2][l]{%
\raisebox{0pt}[0pt][0pt]{\makebox[0pt][#1]{#2}}
}
\newcommand*{\anglelabel}[1]{%
\multicolumn{1}{c}{\rotatebox{45}{\zerobox{#1}}}%
}
\newcommand*{\rotLabel}[1]{%
\anglelabel{\zerobox{#1}}
}

\usepackage{tikz}
\usepackage{mathtools}
\newcommand{\filledcirc}{${\color{black}\bullet}\mathllap{\circ}$}
\newcommand{\normalcirc}{${\color{white}\bullet}\mathllap{\circ}$}
\begin{document}


\begin{tabular}{|lllllllll|}
 \rotLabel{Detects MITM}
& \rotLabel{Detects Local MITM}
& \rotLabel{Protects Client Credential} 
& \rotLabel{Updatable Pins}
& \rotLabel{Detects TLS Stripping}
& \rotLabel{Affirms POST-to-HTTPS}
& \rotLabel{Responsive Revocation}
& \rotLabel{Intermediate CAs Visible}
\\
\hline
\multicolumn{9}{|c|}{\textit{Security Properties Offered}}\\
 &  &  &  & & & & &\\
 \hline
\normalcirc & \normalcirc & \normalcirc &  & & & & &\\
\normalcirc & \normalcirc & \normalcirc &  & & & & &\\
\filledcirc & \filledcirc & \filledcirc & \filledcirc & & & & &\\
\filledcirc & \filledcirc & \filledcirc & \filledcirc & & & & &\\
 & \filledcirc &  & \filledcirc & & & & &\\
 &  & \normalcirc & & & & & &\\
 &  & \normalcirc & & & & & &\\
 &  &  & \filledcirc & & & & &\\
\hline
 &  &  & &\normalcirc &\normalcirc & & &\\
 &  &  & \filledcirc &\filledcirc & \filledcirc & & &\\
 &  &  & \filledcirc &\filledcirc & \filledcirc & & &\\
 &  &  &  & & \filledcirc & & &\\
 \hline
  &  &  &  & & & \filledcirc & &\\
  &  &  &  & & & \filledcirc & &\\
  &  &  &  & & & \filledcirc & &\\
  &  &  &  & & & \filledcirc & \filledcirc & \\
  \hline
\end{tabular}

\end{document}

相关内容