0

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

enter image description here

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

0

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...

enter image description here

1

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}
\renewcommand{\theadalign}{lc}
\renewcommand{\theadfont}{\normalsize\bfseries}
\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
\thead{Group} & \thead{Strategies} & \thead{Data} & \thead{Evaluated} \\
\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 \\
\addlinespace
                 & Second solution & Data 1\nl Data 2\nl Data 3 & Yes \\
\addlinespace
                 & 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} 

enter image description here

0

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/

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.