2

I'm quite new to LaTeX and I would like to create a comparative table where the first row AND the first column of the table are written vertically. I tried several solutions I found on stackexchange with "multicolumn" and "rotate" but none was a success (e.g. the text doesn't appear or it is written horizontally).

I succeeded to create a table with the expected colors via a thread I found here.

The result I wish is the following :

result I wish

The result I have currently :

result I have currently

Code :

\documentclass[11pt]{article}

\usepackage[dvipsnames]{xcolor}
\usepackage{tabu}
\usepackage{colortbl}
\usepackage{array,multirow,graphicx}

\begin{document}

\taburowcolors[2]{white .. black!20}
\tabulinesep=4pt
\begin{tabu}{|>{\cellcolor{black!60}\color{white}}r|X[cm]|X[cm]|}
\hline
\rowcolor{black!80}\cellcolor{black!80}Java & \color{white}Open source& \color{white}\# operators \\
Tool1 & Yes & 1\\
Tool2 & Yes & 2\\
Tool3 & Yes & 3\\
\rowcolor{black!80}\cellcolor{black!80}C/C++ & ~ & ~ \\
Tool1 & Yes & 1\\
Tool2 & No & 2\\
Tool3 & Yes & 3\\
\rowcolor{black!80}\cellcolor{black!80}Python& ~  & ~ \\
Tool1 & No & 1\\
Tool2 & Yes & 2\\
Tool3 & Yes & 3\\
\hline
\end{tabu}

\end{document}
  • welcome to tex.se! please extend your code snippet to complete small document (beginning with \documentclass and ending with \end{document) with this table. – Zarko Dec 10 '18 at 16:57
1

like this?

enter image description here

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{graphicx}
\usepackage{multirow, tabu}

\begin{document}
    \taburowcolors[2]{white .. black!20}
    \tabulinesep=4pt
    \begin{tabu}{>{\columncolor{black!80}\color{white}}c r |
                                                         c | c
                 !{\vrule width 0.5pt}@{}
                 !{\color{black!80}\vrule width 1ex}
                 }
\rowcolor{black!80}
    &  \multicolumn{1}{c!{\color{white}\vline}}{}
            & \multicolumn{1}{c!{\color{white}\vline}}{%
                \rotatebox{90}{\textcolor{white}{Open source}}}
                    & \multicolumn{1}{c!{\color{white}\vline}@{}
                                       !{\color{black!80}\vrule width 1ex}}{%
                        \rotatebox{90}{\textcolor{white}{\# operators}}}    \\
    \hline
\cellcolor{black!80}
    & \cellcolor{black!40}{Tool1}
            & Yes   & 1 \\
\cellcolor{black!80}
    & \cellcolor{black!40}{Tool2} 
            & Yes   & 2 \\
\cellcolor{black!80}
\multirow{-3}{*}[-1ex]{\rotatebox{90}{Java}}
    &  \cellcolor{black!40}{Tool3}
            & Yes   & 3 \\
\rowcolor{black!80}
    &       &       &   \\
\hline
    \end{tabu}
\end{document}
  • Thank you very much, your solution solves my problem :) – Vincent Passau Dec 10 '18 at 18:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.