I've been trying to recreate a table. How do I achieve this table?
Especially how do you make the vertical border didn't meet like the way shown in picture?

- 4,803
- 41
- 1
3 Answers
If you compile this:
\documentclass[12pt]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{c|cccc} \toprule
Algorithms&\begin{tabular}{c}JPEG\\(QF=50)\end{tabular}&%
\begin{tabular}{c}Med-Filter\\$7\times7$\end{tabular}&%
\begin{tabular}{c}Gau-Filter\\$7\times7$\end{tabular}&%
\begin{tabular}{c}Gau-Noise\\$\sigma=0.01$\end{tabular}\\ \midrule
Nakamura \textit{et al.} [12]&$29.51\%$&$8.39\%$&$\mathbf{0.00\%}$&$\mathbf{0.00\%}$\\ \midrule
Primila \textit{et al.} [13]&$38.35\%$&$26.31\%$&$1.19\%$&$22.75\%$\\ \midrule
Gugelmann \textit{et al.} [15]&$15.76\%$&$8.86\%$&$3.93\%$&$16.14\%$\\ \midrule
Proposed &$\mathbf{6.42\%}$&$\mathbf{1.18\%}$&$0.68\%$&$3.37\%$\\ \bottomrule
\end{tabular}
\end{document}
then you will get this:
Note that I don't think that those vertical bars look fine.
- 4,803
-
Regarding retype, I think it's actually better to just put dummy data in so people can focus on the important part (toprule, midrule, bottomrule, booktabs) – user202729 Dec 27 '21 at 11:12
- used is @José Carlos Santos answer (+1 for retyping table) as OP's MWE
- for table is used
tabularraypackages - omitted are all horizontal lines in table body (that table has more "professional" looks)
\documentclass[border=3.1314592]{standalone}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{siunitx, varwidth}
\usepackage{etoolbox}
\newrobustcmd\B{\DeclareFontSeriesDefault[rm]{bf}{b}% %
\bfseries\color{teal}} %
\begin{document}
\begin{tblr}{hline{1,2,Z} = 1pt,
colspec={Q[r,m] | *{4}{Q[c,m,si={detect-weight, % <--
mode=text, % <--
table-format=2.2{,%}}]}
},
measure=vbox
}
\SetCell{c} Algorithms
& {{{JPEG\(QF$=50)$}}} & {{{Med-Filter\$(7\times7)$}}}
& {{{Gauss-Filter\$(7\times7)$}}} & {{{Gauss-Noise\$(\sigma=0.01)$}}} \
%
Nakamura \textit{et al.} \cite{??}
& 29.51,% & 8.39,% &\B 0.00,% &\B 0.00,% \
Primila \textit{et al.} \cite{??}
& 38.35,% & 26.31,% & 1.19,% & 22.75,% \
Gugelmann \textit{et al.} \cite{??}
& 15.76,% & 8.86,% & 3.93,% & 16.14,% \
Proposed
&\B 6.41,% &\B 1.18,% & 0.68,% & 3.37,% \
\end{tblr}
\end{document}
- 296,517
If you actually want to use vertical rules with the (horizontal) rules of booktabs (even though this is not at all in the spirit of booktabs, you can try {NiceTabular} of nicematrix.
\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{c|cccc} \toprule
\Block{2-1}{Algorithms} & JPEG & Med-Filter & Gau-Filter & Gau-Noise \\
& (QF=50) & $7\times7$ & $7\times7$ & $\sigma=0.01$ \\ \midrule
Nakamura \textit{et al.} [12]&$29.51\%$&$8.39\%$&$\mathbf{0.00\%}$&$\mathbf{0.00\%}$\\ \midrule
Primila \textit{et al.} [13]&$38.35\%$&$26.31\%$&$1.19\%$&$22.75\%$\\ \midrule
Gugelmann \textit{et al.} [15]&$15.76\%$&$8.86\%$&$3.93\%$&$16.14\%$\\ \midrule
Proposed &$\mathbf{6.42\%}$&$\mathbf{1.18\%}$&$0.68\%$&$3.37\%$\\ \bottomrule
\end{NiceTabular}
\end{document}
You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).
- 40,250



booktabspackage(toprule, midrule, bottomrule)with usual vertical lines to get such broken lines. There are many examples of such tables on this site. – Imran Dec 26 '21 at 16:01booktabs, see 1 2 3 – user202729 Dec 27 '21 at 08:40