# how to make a table contain multiple rows in some cells?

I am trying to do a table like the one in the attached figure

I am using:

\begin{table}

\small

\begin{tabular}{|p{1.1cm}|p{2.3cm}|p{2cm}|p{3.2cm}|p{1.5cm}| p{1.1cm}|}

\end {table}


but failed to do as some cell needs to be divided into multiple rows. Could any one help in this, would be appreciated

Is this what you intend ? --

\documentclass{article}

\begin{document}

\begin{table} \small%
\begin{tabular}{|p{1.1cm}|p{2.3cm}|p{2cm}|p{3.2cm}|p{1.5cm}| p{1.1cm}|}
\hline
Group & Strategies & Data & Evaluated \\
\hline
Baseline & First strategy & Data 1 & Yes \\
\cline{2-2} \cline{4-4}
& Second strategy & Data 2 & No \\
\hline
Solution & First solution & Data 1 & Yes \\
&                & Data 2 &  \\
\cline{2-4}
& Second solution & Data 1 & Yes \\
&                & Data 2 &  \\
&                & Data 3 &  \\
\cline{2-4}
& Third solution & Data 1 & No \\
&                & Data 2 &  \\
&                & Data 3 &  \\
\hline
\end{tabular}
\end{table}

\end{document}


most probably producing a table that looks like this...

I propose one of these three layouts, based on tabularx, booktabs (for horizontal rules with some padding) and \makecell (allows for line breaks in the standard cells). The more professional-looking, in my opinion, is with only a few horizontal line of various thicknesses:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx, makecell, booktabs}
\renewcommand{\cellalign}{lc}
\newcommand\nl{\newline}

\begin{document}

\begin{table}[!htb]
\small\sffamily\centering%
\setlength{\extrarowheight}{2pt}
\begin{tabularx}{\linewidth}{|l|*{2}{X|}c|}
\hline
Group & Strategies & Data & Evaluated \\
\hline
Baseline & First strategy & Data 1 & Yes \\
\cline{2-2} \cline{4-4}
& Second strategy & Data 2 & No \\
\hline
Solution & First solution & Data 1\nl Data 2 & Yes \\
\cline{2-4}
& Second solution & Data 1\nl Data 2\nl Data 3 & Yes \\
\cline{2-4}
& Third solution & Data 1\nl Data 2\nl Data 3 & No \\
\hline
\end{tabularx}
\end{table}

\begin{table}[!htb]
\small\sffamily\centering%
\begin{tabularx}{\linewidth}{l*{2}{X}c}
\toprule
\midrule
Baseline & First strategy & Data 1 & Yes \\
& Second strategy & Data 2 & No \\
\cmidrule(lr){1-4}
Solution & First solution & Data 1\nl Data 2 & Yes \\
& Second solution & Data 1\nl Data 2\nl Data 3 & Yes \\
& Third solution & Data 1\nl Data 2\nl Data 3 & No \\
\bottomrule
\end{tabularx}
\end{table}

\begin{table}[!htb]
\small\sffamily\centering%
\setlength{\extrarowheight}{2pt}
\begin{tabular}{|*{4}{l|}}
\hline
Group & Strategies & Data & Evaluated \\
\hline
Baseline & First strategy & Data 1 & Yes \\
\cline{2-2} \cline{4-4}
& Second strategy & Data 2 & No \\
\hline
Solution & First solution & \makecell{Data 1\\ Data 2 } & Yes \\
\cline{2-4}
& Second solution & \makecell{Data 1 \\ Data 2 \\ Data 3} & Yes \\
\cline{2-4}
& Third solution & \makecell{Data 1 \\ Data 2 \\ Data 3} & No \\%
\hline
\end{tabular}
\end{table}

\end{document}


You can use the multirow package for this - see for example

https://texblog.org/2012/12/21/multi-column-and-multi-row-cells-in-latex-tables/