0

I would like to draw the following table enter image description here here is my code :

\documentclass{article} 
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\usepackage{tabularx, multirow, makecell, rotating} %
\usepackage{enumitem}
\begin{document}
\begin{center}
    \begin{tabular}{ | l | l | p{5cm} |}
    \hline
      \rowcolor{blue!30} \rothead{Cell 1} &   \rowcolor{blue!30} \rothead{Cell 2}  &   \rowcolor{blue!30} Summary \\ \hline
    \rothead{very long vertical text } & \rothead{very long vertical text }  &   \begin{itemize} \item very long text up here right here   \item very long text up here right here  \item very long text up here right here   \end{itemize}\\ \hline
    \rothead{very long vertical text } & \rothead{very long vertical text }  &   \begin{itemize} \item very long text up here right here   \item very long text up here right here  \item very long text up here right here   \end{itemize}\\ \hline
      \rothead{very long vertical text } & \rothead{very long vertical text }  &   \begin{itemize} \item very long text up here right here   \item very long text up here right here  \item very long text up here right here   \end{itemize}\\ \hline
    \end{tabular}
\end{center}
\end{document}

which produces :

enter image description here

  • Well, you seem to have it. What is your problem? – Bernard Apr 29 '18 at 9:00
  • 1
    in what is this question different from your tex.stackexchange.com/questions/427154/how-to-draw-simple-table? there you have answer which solve your problem ... – Zarko Apr 29 '18 at 9:01
  • @Bernard nope i don't have it yet, it's produces ugly table – Educ Apr 29 '18 at 9:16
  • @Zarko Yes it's different from that question could you produces this one – Educ Apr 29 '18 at 9:17
  • no, it is not different so much. see answer below. – Zarko Apr 29 '18 at 9:55
3

is this close enough to what you like to have?

enter image description here

\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\usepackage{tabularx, multirow, makecell, rotating} %
\usepackage{enumitem}

\usepackage{etoolbox}
\AtBeginEnvironment{tabular}{%
    \setlist[itemize]{nosep,
                        topsep     = 0pt,
                        partopsep  = 0pt,
                        leftmargin = *,
                        label      = $\bullet$,
                        before     = \vspace{-0.6\baselineskip},
                        after      = \vspace{-\baselineskip}
                     } }
\makeatletter
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip] % for centering vertical text
  \turn{\cellrotangle}\thead[#1]{#2}\endturn}}
\makeatother
\begin{document}
\begin{center}
    \begin{tabular}{ | l | l | p{5cm} |}
    \hline
\rowcolor{blue!30} 
Cell 1    
    &  Cell 2  
        &   Summary                             \\ \hline
\multirow{6}{*}{\rothead[c]{very long\\ vertical text}}% text had to be manually  
                                                       % broken into two lines 
    & \multirow{6}{*}{\rothead[c]{very long\\ vertical text}}   
        &   \begin{itemize} 
        \item very long text up here right here   
        \item very long text up here right here  
        \item very long text up here right here   
        \end{itemize}                           \\ \hline
\multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
    & \multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
        &   \begin{itemize} 
        \item very long text up here right here   
        \item very long text up here right here  
        \item very long text up here right here   
        \end{itemize}                           \\ \hline
\multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
    & \multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
        &   \begin{itemize} 
        \item very long text up here right here   
        \item very long text up here right here  
        \item very long text up here right here 
            \end{itemize}                       \\ \hline
    \end{tabular}
\end{center}
\end{document}

addendum (1):

since doesn't work well withcolortblwhich is called by[table]{xcolor}for rotating cellsCell 1andCell 2is better to use\rotateboxfrom the packagegraphicxthan\rothead`:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\usepackage{tabularx, multirow, makecell, rotating} %
\usepackage{graphicx}
\usepackage{enumitem}

\usepackage{etoolbox}
\AtBeginEnvironment{tabular}{%
    \setlist[itemize]{nosep,
                        topsep     = 0pt,
                        partopsep  = 0pt,
                        leftmargin = *,
                        label      = $\bullet$,
                        before     = \vspace{-0.6\baselineskip},
                        after      = \vspace{-\baselineskip}
                       } }
\makeatletter
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[#1]{#2}\endturn}}
\makeatother
\begin{document}
\begin{center}
    \begin{tabular}{ | l | l | p{5cm} |}
    \hline
\rowcolor{blue!30}
\multicolumn{1}{|c|}{\rotatebox[origin=c]{90}{ Cell 1 }}% observe added spaces before and after text in cell
    &  \multicolumn{1}{c|}{\rotatebox[origin=c]{90}{ Cell 2 }}
        &   Summary                             \\ \hline
\multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
    & \multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
        &   \begin{itemize}
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \end{itemize}                           \\ \hline
\multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
    & \multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
        &   \begin{itemize}
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \end{itemize}                           \\ \hline
\multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
    & \multirow{6}{*}{\rothead[c]{very long\\ vertical text}}
        &   \begin{itemize}
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
            \end{itemize}                       \\ \hline
    \end{tabular}
\end{center}
\end{document}

which givews

enter image description here

addendum (2):

regarding your additional demand in your comment: to have rotated long text in one column can make trouble to you. it is in multirow environment, which vertical size is equal to sum of heights of spanned lines. this means, that can happens that you will need to additional (empty) vertical space on the next columns. the result will probably be (very) ugly ...

anyway, the following example has vertical lines in one lines:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\usepackage{tabularx, multirow, makecell, rotating} %
\usepackage{graphicx}
\usepackage{enumitem}

\usepackage{etoolbox}
\AtBeginEnvironment{tabular}{%
    \setlist[itemize]{nosep,
                        topsep     = 0pt,
                        partopsep  = 0pt,
                        leftmargin = *,
                        label      = $\bullet$,
                        before     = \vspace{-0.6\baselineskip},
                        after      = \vspace{-\baselineskip}
                       } }
\makeatletter
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[#1]{#2}\endturn}}
\makeatother
\begin{document}
\begin{center}
    \begin{tabular}{ | l | l | p{5cm} |}
    \hline
\rowcolor{blue!30}
\multicolumn{1}{|c|}{\rotatebox[origin=c]{90}{ Cell 1 }}% observe added spaces before and after text in cell
    &  \multicolumn{1}{c|}{\rotatebox[origin=c]{90}{ Cell 2 }}
        &   Summary                             \\ \hline
\multirow{10}{*}{\rothead[c]{very long vertical text}}
    & \multirow{10}{*}{\rothead[c]{very long vertical text}}
        &   \begin{itemize}
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \end{itemize}                           \\ \hline
\multirow{10}{*}{\rothead[c]{very long vertical text}}
    & \multirow{10}{*}{\rothead[c]{very long vertical text}}
        &   \begin{itemize}
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \end{itemize}                           \\ \hline
\multirow{10}{*}{\rothead[c]{very long vertical text}}
    & \multirow{10}{*}{\rothead[c]{very long vertical text}}
        &   \begin{itemize}
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
        \item very long text up here right here
            \end{itemize}                       \\ \hline
    \end{tabular}
\end{center}
\end{document}

enter image description here

  • wait for me please to test it by the way +1 already – Educ Apr 29 '18 at 9:36
  • But Cell 1 and 2 i want them in vertical position and summary centerd in cell – Educ Apr 29 '18 at 9:39
  • i say in answer, why this is not good to do. if you anyway like to have in vertical position, than enclose them in \rothead{...} – Zarko Apr 29 '18 at 9:41
  • when I add rothead{...} it's gives me bad looks – Educ Apr 29 '18 at 9:47
  • i.stack.imgur.com/zOfST.jpg – Educ Apr 29 '18 at 9:49

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.