0

Follwing this anwser of @Zarko in this question How to draw this table

I still not satisfied, I would like to have rotated long text in one column but this can make trouble to me since it is in multirow environment, which vertical size is equal to sum of heights of spanned lines. this means, that can happens that I will need to additional (empty) vertical space on the next columns. thus, I wonder if there is any way to slove that problem

I tried this code of @Zarko, but the solution as he said I need to additional (empty) vertical space on the next columns. so is there any way to solve that problem with adding any additional (empty) vertical space.

The solution of Zarko by adding additional (empty vertical space ) doesn't fit my needs I'm looking for any different solution than that

    \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{8cm} |}
    \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 very long text up here right here}}
    & \multirow{10}{*}{\rothead[c]{very long vertical text very long text up here right here}}
        &   \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 very long text up here right here}}
    & \multirow{10}{*}{\rothead[c]{very long vertical text very long text up here right here}}
        &   \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 very long text up here right here}}
    & \multirow{10}{*}{\rothead[c]{very long vertical text very long text up here right here}}
        &   \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}

which produces

enter image description here

  • your solution doesn't fit my needs I mention it in my question – Educ Apr 29 '18 at 16:57
  • @Zarko How can I add additional (empty vertical space ) to solve that problem – Educ Apr 29 '18 at 17:17
  • try exerimenting with `\vspace*{< desired amount >} before and after itemize environment. – Zarko Apr 29 '18 at 17:36
  • i'm sorry but this solution doesn't solve my question could you come up with new good solution – Educ Apr 29 '18 at 20:51
2

I'm not sure what this will be good for. Anyway, here it is: as usual, \multirow is not the solution.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\usepackage{array}
\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}
  }%
}

\newcommand{\rotcell}[1]{%
  \rotatebox[origin=c]{90}{ #1 }%
}

\begin{document}
\begin{center}
\begin{tabular}{ | c | c | m{8cm} |}
\hline
\rowcolor{blue!30}
\rotcell{Cell 1} & \rotcell{Cell 2} & Summary \\
\hline
\rotcell{very long vertical text very long text up here right here} &
\rotcell{very long vertical text very long text up here right here} &
\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
\rotcell{very long vertical text very long text up here right here} &
\rotcell{very long vertical text very long text up here right here} &
\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
  \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

If you want to control the line breaks in the rotated parts:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\usepackage{array}
\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}
  }%
}

\newcommand{\rotcell}[1]{%
  \rotatebox[origin=c]{90}{\begin{tabular}{c}#1\end{tabular}}%
}

\begin{document}
\begin{center}
\begin{tabular}{ | c | c | m{8cm} |}
\hline
\rowcolor{blue!30}
\rotcell{Cell 1} & \rotcell{Cell 2} & Summary \\
\hline
\rotcell{very long vertical text very long text up here right here} &
\rotcell{very long vertical text very long text up here right here} &
\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
\rotcell{very long vertical text \\ very long text up here right here} &
\rotcell{very long vertical text \\ very long text up here right here} &
\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
  \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

  • 1
    @Educ Please, make complete questions. For breaking tables across pages, use longtable. – egreg Apr 29 '18 at 21:51

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.