2

I want to create a table like this in Latex : Sample table

I am unable to figure out how to go about merging cells in column 1 & 2 and also adding bullet points in column 3. Can anyone help in figuring out how to go about it ?

So far I am able to come up with this:

\documentclass[a4paper]{article}
\usepackage{multirow}
\usepackage{makecell}
% From https://tex.stackexchange.com/a/150650/85834
\newcommand{\tabitem}{~~\llap{\textbullet}~~}
\begin{document}
\begin{center}
    \begin{tabular}{| c | c | c |}
        \hline
        \multirow{2}{2.5cm}{Deep Learning} & \ \makecell{Medical Image \\ Analysis} &
    \tabitem Built a deep learning model using Mask R-CNN for instance segmentation of nuclei images\\\cline{2-3}
                                           & \ \makecell{Image \\ Classification}\\\hline
        \multirow{2}{*}{Time Series}       & \ \makecell{Walmart Sales \\
        Forecasting}                       & \ \tabitem Built a deep learning model using Mask R-CNN
        for instance segmentation of nuclei images \\
                                           & \ \makecell{Rossmann Sales \\ Forecasting}\\\hline
    \end{tabular}
\end{center}
\label{tab:multicol}
\end{document}
  • This was harder than I thought! I would think in LaTeX that this should be easy, but it's not! – Andreas Storvik Strauman May 30 '18 at 19:50
1

With the enumitem package you can define your own itemize like enviroment that you can use for lists inside table cells. tabularx additionally helps automatically make the table span the textwidth:

\documentclass[a4paper]{article}
\usepackage{multirow}
\usepackage{array}
\usepackage{tabularx}
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1}
\setlist[tabitemize]{nosep,
                  topsep= 0pt,
                  partopsep=0pt,
                  leftmargin= *,
                  label=\textbullet,
                  before=\vspace{0.3\baselineskip},
                  after=\vspace{-\baselineskip}
                  }
\renewcommand\tabularxcolumn[1]{m{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}


\begin{document}
\begin{tabularx}{\textwidth}{| M{1.5cm} | M{2.25cm} | X |}
  \hline
  \multirow{3}{1.5cm}{\centering Deep Learning} 
  & Medical Image Analysis 
  & \begin{tabitemize} 
       \item Built a deep learning model using Mask R-CNN for instance segmentation of nuclei images 
       \item another long line of text
    \end{tabitemize}\\ 
  \cline{2-3}
  & Image \newline Classification 
  & \begin{tabitemize} 
       \item first long line of text 
       \item another long line of text 
    \end{tabitemize}\\ 
  \hline
  \multirow{3}{1.5cm}{\centering Time Series} 
  & Walmart Sales Forecasting 
  & \begin{tabitemize} 
       \item long text 
    \end{tabitemize} \\ 
  \cline{2-3}
  & Rossman Sales Forecast 
  & \begin{tabitemize} 
       \item long text 
    \end{tabitemize} \\
  \hline
\end{tabularx}
\end{document}

enter image description here

Personally, I would recommend a different design:

enter image description here

Here, I have removed all vertical lines and replaced the horizontal rules by rules from the booktabs package. Additionally, I have aligned all entries of the table cells to the top and added some vertical white space to guide the eye.

\documentclass[a4paper]{article}
\usepackage{tabularx}
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1}
\setlist[tabitemize]{nosep,
                  topsep= 0pt,
                  partopsep=0pt,
                  leftmargin= *,
                  label=\textbullet,
                  before=\vspace{-0.6\baselineskip},
                  after=\vspace{-\baselineskip}
                  }
\usepackage{booktabs}

\begin{document}
\begin{tabularx}{\textwidth}{ p{1.5cm}  p{2.25cm}  X }
  \toprule
  Deep \newline Learning 
  & Medical Image Analysis 
  & \begin{tabitemize} 
       \item Built a deep learning model using Mask R-CNN for instance segmentation of nuclei images 
       \item another long line of text
    \end{tabitemize}\\ 
     \addlinespace[2ex]
  & Image \newline Classification 
  & \begin{tabitemize} 
       \item first long line of text 
       \item another long line of text 
    \end{tabitemize}\\ 
  \midrule
  Time \newline Series
  & Walmart Sales Forecasting 
  & \begin{tabitemize} 
       \item long text 
    \end{tabitemize} \\ 
     \addlinespace[2ex]
  & Rossman Sales Forecast 
  & \begin{tabitemize} 
       \item long text 
    \end{tabitemize} \\
  \bottomrule
\end{tabularx}
\end{document}

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.