I want to draw missing vertical lines in a tabular
. I think \multirow{2}{*}{}
prevents table's vertical line to be drawn.
My code:
\documentclass{article}
\usepackage[a4paper,margin=1in,landscape]{geometry}
\usepackage{makecell}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\begin{center}
\begin{table*}[!t] %
\centering
\caption{Results ...}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
\textbf{Test} & \multicolumn{2}{c|}{Workflow} & Method
& \multirow{2}{*}{\makecell{Completion \\ Time (min)}}
& \multirow{2}{*}{\makecell{Gas Used for \\
\textit{submitJob} (gas)}}
& \multirow{2}{*}{\makecell{Gas Used for \\
\textit{processPayment} (gas)}}
& \multirow{2}{*}{\makecell{Actual/Complete \\ Cost
(\textit{Cent})}}
& \multirow{2}{*}{\makecell{Failed}} \\
\cmidrule(lr){2-3}
& $|V|$ & $|E|$ \\
\hline
$T_1$ & 16 & 28 & ALGO & 27 & 1722983 & 1942770 & 0.827/0.827 & 0 \\ \hline
\end{tabular}
\end{table*}
\end{center}
\end{document}
output:
Best Answer
You can use
nicematrix
with thehvlines
option. The command for both multirow and multicolumn cells is\Block
.Remember that
\Block
does not cause the cells to be skipped so&&
is necessary between the Workflow and Method cells. Also don't forget to compile twice.The line
\NiceMatrixOptions{cell-space-limits = 2pt}
is optional and creates some additional vertical space between rows.