1

Good night,

I'm using the Elsevier journal template, I need to set up a table like Image 1. I'm a beginner in TeX and I still have not understood how to merge cells into a table. Ideally, the table should be in the format of Image 2. The code I have in the template is:

\begin{table}[h]
\centering
\begin{tabular}{l l l l l}
\hline
\textbf{Author} & \textbf{Year} & \textbf{Blockchain} & \textbf{Implementation}\\
\hline
{[31]} & 2018 & Ethereum & None \\
{[33]} & 2018 & Ethereum & Simulation \\
{[34]} & 2017 & Ethereum & Simulation \\
{[36]} & 2018 & Ethereum & Complete \\
{[37]} & 2017 & Ethereum & Simulation \\
\hline
\end{tabular}
\caption{Related Work.}
\end{table}

Table from template:

enter image description here

Table I need:

enter image description here

The second image I did in Word, but it must be in the format of the template I'm using.

imnothere
  • 14,215
Mutante
  • 245

1 Answers1

1
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{tabular}{|c|c|c|c|}
    \hline
    City & N & Case & Gas used \\ 
    \hline
    \multirow{4}{*}{Coimbra} & \multirow{2}{*}{N1 Coimbra} & Case 1C & Gas 1C \\ \cline{3-4}
    & & Case 2C & Gas 2C \\ \cline{2-4}
    & \multirow{2}{*}{N2 Coimbra} & Case 3C & Gas 3C \\ \cline{3-4}
    & & Case 4C & Gas 4C \\ \hline
    \multirow{4}{*}{S\~ao Paulo} & \multirow{2}{*}{N1 S\~aoPaulo} & Case 1S & Gas 1S \\ \cline{3-4}
    & & Case 2S & Gas 2S \\ \cline{2-4}
    & \multirow{2}{*}{N2S\~ao Paulo} & Case 3S & Gas 3S \\ \cline{3-4}
    & & Case 4S & Gas 4S \\ \hline
\end{tabular}
\end{document}