2

Sometimes I want to group some rows like that:

Desired table

Now I can do that like that:

\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}

But I find it invonvenient and hard for other to understand it scemantically which items are for privacy and which are for UX on tex. Therefore I would like a more convenient way to do that:

\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}

Is there a way or an existing package that allows me to do that?

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.