4

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? enter image description here

Indah AFS
  • 41
  • 1
  • 1
    Welcome to TeX,SE! Professional looking tables haven't vertical lines. If tables have them then they are also present at left and right border of table. BTW, help us to help you and provide what you tray so far. The best is small complete document which produce table showed in question. – Zarko Dec 26 '21 at 15:45
  • 1
    You may use horizontal lines from the booktabs package (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:01
  • Note that (as mentioned above) you should not be using vertical rules anyway, especially with booktabs, see 1 2 3 – user202729 Dec 27 '21 at 08:40

3 Answers3

4

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:

enter image description here

Note that I don't think that those vertical bars look fine.

  • 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
4
  • used is @José Carlos Santos answer (+1 for retyping table) as OP's MWE
  • for table is used tabularray packages
  • 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}

enter image description here

Zarko
  • 296,517
0

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

Output of the above code

F. Pantigny
  • 40,250