-1

I would like to draw the following table with itemize feature inside the cells In order to do that I thought that if I added this code it's gonna work but it doesn't

\setlist[itemize]{nosep,
              topsep= 0pt,
              partopsep=0pt,
              leftmargin= *,
              label=\textendash,
              before=\vspace{-0.6\baselineskip},
              after=\vspace{-\baselineskip}
              }

Here is the code to draw a table that I want to add to it itemize enviroment inside his cells

   \begin{center}
\bfseries
\settowidth\rotheadsize{Title 1}
\begin{tabularx}{\linewidth}{|c|>{\centering\arraybackslash}X|}
    %\hline
%\multicolumn{3}{|>{\centering\arraybackslash}%
                 %p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth\relax}|}{\cellcolor{gray!30}
    %Title 2}    \\
    \hline
\cellcolor{gray!30} Cell 1 & \cellcolor{gray!30} Cell 2     \\
    \hline
\multirow[b]{3}{*}{Info 2}   
            & very long text but centered
 \rule[-1em]{0pt}{2.5em} \\
    \cline{2-2}
   & very long text but centered
   \rule[-1em]{0pt}{2.5em} \\
    \cline{2-2}
    &  very long text but centered   \rule[-1em]{0pt}{2.5em} \\
    \hline
        \multirow[b]{3}{*}{Info 2}   
            & very long text but centered
 \rule[-1em]{0pt}{2.5em} \\
    \cline{2-2}
   & \begin{itemize}
    -     \item very long text 
          \item very long text 
    \end{itemize}
   \rule[-1em]{0pt}{2.5em} \\
    \cline{2-2}
    &     \rule[-1em]{0pt}{2.5em} \\
    \hline
\end{tabularx}
    \end{center}
5
  • @Zarko No it's not duplicate
    – Educ
    Apr 27 '18 at 13:22
  • It's not duplicate since your code way in your old answer doesn't fit my needs for this kind of table
    – Educ
    Apr 27 '18 at 13:25
  • of course it is. one different row in your table should not be a problem. regarding itemize you have the very same problem as in your question in the link. my answer solve this perfectly (Bernard answer not differ much from mine).
    – Zarko
    Apr 27 '18 at 13:26
  • give me some time to check again
    – Educ
    Apr 27 '18 at 13:27
  • Could you please add your answer too to see what you add it based on your old answer
    – Educ
    Apr 27 '18 at 13:28
3

Is it what you want?

     \documentclass{article}
    \usepackage{tabularx}
    \usepackage{amsmath}
    \usepackage[table]{xcolor}
    \usepackage{tabularx, multirow, makecell, rotating} %
    \usepackage{enumitem}
    \makeatletter
    \newcommand*{\compress}{\@minipagetrue}
    \makeatother

    \begin{document}

     \begin{center}
    \bfseries\setlength{\extrarowheight}{3pt}
    \settowidth\rotheadsize{Title 1}
    \setlist[itemize]{nosep,
                  topsep= 0pt,
                  partopsep=0pt,
                  leftmargin= *,
                  label=\textendash,
                  after=\vspace{-\baselineskip}
                  }
    \begin{tabularx}{\linewidth}{|c|>{\centering\arraybackslash\compress}X|}
        \hline
    \rowcolor{gray!30} Cell 1 & Cell 2 \\
        \hline
    \multirow[b]{3}{*}{Info 2}
                & very long text but centered
     \rule[-1em]{0pt}{2.5em} \\
        \cline{2-2}
       & very long text but centered
      \rule[-1em]{0pt}{2.5em} \\
        \cline{2-2}
        & very long text but centered \rule[-1em]{0pt}{2.5em} \\
        \hline
            \multirow[b]{3}{*}{Info 2}
                & very long text but centered
     \rule[-1em]{0pt}{2.5em} \\
        \cline{2-2}
       & \begin{itemize}
      \item very long text
     \item very long text
     \end{itemize}
     \rule[-1em]{0pt}{2.5em}
      \\
        \cline{2-2}
        & \rule[-1em]{0pt}{2.5em} \\
        \hline
    \end{tabularx}
    \end{center}

    \end{document} 

enter image description here

4
  • I don't know why when I add this code to mine gives me some errors
    – Educ
    Apr 27 '18 at 13:38
  • Which errors? Can you compile just this code?
    – Bernard
    Apr 27 '18 at 13:42
  • this code works fine but when i add it to my whole document it's give me 15O error but when i add \\ after end{itemize} it's works i don't know why
    – Educ
    Apr 27 '18 at 13:49
  • Could you post a minimal code showing those errors?
    – Bernard
    Apr 27 '18 at 15:22

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