表格行分组更简单

表格行分组更简单

有时我想将一些行分组如下:

所需表

现在我可以这样做:

\documentclass[a4paper]{report}
\usepackage{geometry}
\geometry{a4paper,total={170mm,257mm},left=20mm,top=20mm}

\usepackage{makeidx}
\usepackage{xltxtra}
\usepackage{libertine}

%------------------------------------------------------------------------------------- Table Settings
\usepackage{multirow}
\usepackage{makecell}%To keep spacing of text in tables
\usepackage{colortbl,xcolor}

\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
%------------------------------------------------------------------------------------- Color


\begin{document}

\begin{table}[ht!]
         \centering
         \def\arraystretch{1.5}
         \label{TOR:FREEDOM:COMPARE}
        \begin{tabular}{c|L{7cm}|L{7cm}|}
            \hline
              \rowcolor{red} \multicolumn{1}{c}{} &  \multicolumn{1}{c|}{\textcolor{white}{\large{\textbf{TOR}}}}  & \multicolumn{1}{c}{\textcolor{white}{\large{\textbf{Freedom}}}}\\
             \hline
             %-----Category---|-------- TOR ----- | ----- Freedom ------- 
              \multirow{2}{*}{\rotatebox[origin=c]{90}{Privacy}}& + Anonymization& + Pseudo-anonymization\\ 
              & + Unlinkability & \\
             \hline
             \multirow{5}{*}{\rotatebox[origin=c]{90}{Operational}}&+ Hidden Services & + Mailing System \\
              &+ Decentralized System & - Partially Centralized\\
              &+ Use AES & - Use 3DES\\
              &+ Open Protocol & - Closed Product\\
              &- TCP Only & + TCP and UDP Support\\
             \hline
        \end{tabular}
    \end{table}

\end{document}

但我发现这很不方便,也很难让其他人从概念上理解哪些项目用于隐私,哪些项目用于 UX on tex。因此,我希望有一种更方便的方式来做到这一点:

\begin{table}[ht!]
         \centering
         \def\arraystretch{1.5}
         \label{TOR:FREEDOM:COMPARE}
        \begin{tabular}{c|L{7cm}|L{7cm}|}
            \hline
              \rowcolor{red} \multicolumn{1}{c|}{\textcolor{white}{\large{\textbf{TOR}}}}  & \multicolumn{1}{c}{\textcolor{white}{\large{\textbf{Freedom}}}}\\
             \hline
              \begin{rowgroup}{Privacy}
              + Anonymization& + Pseudo-anonymization\\ 
              + Unlinkability & \\
              \end{rowgroup}
             \hline
             \begin{rowgroup}{Operational}
              + Hidden Services & + Mailing System \\
              + Decentralized System & - Partially Centralized\\
              + Use AES & - Use 3DES\\
              + Open Protocol & - Closed Product\\
              - TCP Only & + TCP and UDP Support\\
              \end{rowgroup}
             \hline
        \end{tabular}
    \end{table}

是否有办法或现有的包可以让我做到这一点?

相关内容