0

I have the following table:

\begin{table}[h!]
\caption{\textls[-15]{Results of GAN image detection tests for digital (left) and printed and scanned images (right). Best results are highlighted in yellow}}
\label{tab:resultsgan}
\tiny
\arrayrulecolor{black}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} 
\hline
\rowcolor[rgb]{0.863,0.863,0.863} {\cellcolor[rgb]{0.863,0.863,0.863}} & {\cellcolor[rgb]{0.863,0.863,0.863}} & {\cellcolor[rgb]{0.863,0.863,0.863}} & \multicolumn{4}{c|}{\textbf{Digital images testing results}} & \multicolumn{4}{c|}{\textbf{Printed and scanned testing images results}} \\ 
\hhline{|>{\arrayrulecolor[rgb]{0.863,0.863,0.863}}--->{\arrayrulecolor{black}}--------|}
\rowcolor[rgb]{0.863,0.863,0.863} \multirow{-2}{*}{{\cellcolor[rgb]{0.863,0.863,0.863}}\textbf{Method}} & \multirow{-2}{*}{{\cellcolor[rgb]{0.863,0.863,0.863}}\textbf{Training/Validation Data}} & \multirow{-2}{*}{{\cellcolor[rgb]{0.863,0.863,0.863}}\textbf{Input Size}} & \textbf{Acc} & \textbf{F} & \textbf{Precision} & \textbf{Recall} & \textbf{Acc} & \textbf{F} & \textbf{Precision} & \textbf{Recall} \\ 
\hhline{|--->{\arrayrulecolor{black}}------->{\arrayrulecolor{black}}-|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{DENSENET} ~\cite{marraetal:2018,HUANGETAL:2017} & {\cellcolor[rgb]{0.863,0.941,0.941}}Images Patches & 224x224x3 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{INCEPTION-V3} ~\cite{marraetal:2018,Szegedyetal:2016} & {\cellcolor[rgb]{0.863,0.941,0.941}}Images Patches & 224x224x3 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{XCEPTION}~\cite{marraetal:2018,chollet:2017}  & {\cellcolor[rgb]{0.863,0.941,0.941}}Images Patches & 299x299x3 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{CONET} ~\cite{lakshmananetal:2019} & {\cellcolor[rgb]{0.863,0.941,0.941}}Co-occurency Matrices & 256x256x3 & 0.96 & 0.96 & 0.95 & 0.98 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{CROSSCONET}~\cite{barnietal:2020}& {\cellcolor[rgb]{0.863,0.941,0.941}}Co-occurency Matrices & 256x256x6 & 0.99 & 0.99 & 0.98 & 1.00 & {\cellcolor{yellow}}0.50 & {\cellcolor{yellow}}0.29 & {\cellcolor{yellow}}0.50 & {\cellcolor{yellow}}0.21 \\
\hline
\end{tabular}
\end{table}

However, whenever I run the latex compiler I receive errors such as

Misplaced \noalign. ...black}}------>{\arrayrulecolor{black}}-|}

How can I solve such a problem?

0

3 Answers 3

1

You didn't provide an example document, if I put your tabular unchanged into a minimal document then it gives no error.

enter image description here

\documentclass[landscape]{article}

\setlength\oddsidemargin{-1cm}
\usepackage{colortbl,hhline,multirow}

\begin{document}

\arrayrulecolor{black}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} 
\hline
\rowcolor[rgb]{0.863,0.863,0.863} {\cellcolor[rgb]{0.863,0.863,0.863}} & {\cellcolor[rgb]{0.863,0.863,0.863}} & {\cellcolor[rgb]{0.863,0.863,0.863}} & \multicolumn{4}{c|}{\textbf{Digital images testing results}} & \multicolumn{4}{c|}{\textbf{Printed and scanned testing images results}} \\ 
\hhline{|>{\arrayrulecolor[rgb]{0.863,0.863,0.863}}--->{\arrayrulecolor{black}}--------|}
\rowcolor[rgb]{0.863,0.863,0.863} \multirow{-2}{*}{{\cellcolor[rgb]{0.863,0.863,0.863}}\textbf{Method}} & \multirow{-2}{*}{{\cellcolor[rgb]{0.863,0.863,0.863}}\textbf{Training/Validation Data}} & \multirow{-2}{*}{{\cellcolor[rgb]{0.863,0.863,0.863}}\textbf{Input Size}} & \textbf{Acc} & \textbf{F} & \textbf{Precision} & \textbf{Recall} & \textbf{Acc} & \textbf{F} & \textbf{Precision} & \textbf{Recall} \\ 
\hhline{|--->{\arrayrulecolor{black}}------->{\arrayrulecolor{black}}-|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{DENSENET} ~\cite{marraetal:2018,HUANGETAL:2017} & {\cellcolor[rgb]{0.863,0.941,0.941}}Images Patches & 224x224x3 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{INCEPTION-V3} ~\cite{marraetal:2018,Szegedyetal:2016} & {\cellcolor[rgb]{0.863,0.941,0.941}}Images Patches & 224x224x3 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{XCEPTION}~\cite{marraetal:2018,chollet:2017}  & {\cellcolor[rgb]{0.863,0.941,0.941}}Images Patches & 299x299x3 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & {\cellcolor{yellow}}1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{CONET} ~\cite{lakshmananetal:2019} & {\cellcolor[rgb]{0.863,0.941,0.941}}Co-occurency Matrices & 256x256x3 & 0.96 & 0.96 & 0.95 & 0.98 & 0.50 & 0.00 & 0.00 & 0.00 \\ 
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
{\cellcolor[rgb]{0.863,0.941,0.941}}\textbf{CROSSCONET}~\cite{barnietal:2020}& {\cellcolor[rgb]{0.863,0.941,0.941}}Co-occurency Matrices & 256x256x6 & 0.99 & 0.99 & 0.98 & 1.00 & {\cellcolor{yellow}}0.50 & {\cellcolor{yellow}}0.29 & {\cellcolor{yellow}}0.50 & {\cellcolor{yellow}}0.21 \\
\hline
\end{tabular}

\end{document}

1

After correcting your table code (considering @David Carlisle comment), extended your code fragment to complete, compilable document I recognize, that your table is to huge that can be fit into portrait page text width. A possible solution is rotate table to landscape orientation:

\documentclass{article}
\usepackage[showframe,
            margin=25mm]{geometry}
\usepackage{rotating}
\usepackage[table]{xcolor}
\definecolor{mygray}{rgb}{0.863,0.863,0.863}
\definecolor{myteal}{rgb}{0.863,0.941,0.941}
\usepackage{array, hhline, multirow}
\usepackage[skip=1ex]{caption}
\usepackage{subcaption}
\usepackage{siunitx}
%
\NewExpandableDocumentCommand\mcc{O{1}m}
    {\multicolumn{#1}{c|}{#2}}
\NewExpandableDocumentCommand\CHead{m}
    {\renewcommand\arraystretch{1}
     \begin{tabular}{@{} >{\footnotesize\bfseries}c @{}}
        #1
     \end{tabular}}

\begin{document}
    \begin{sidewaystable}[ht]
\caption{Results of GAN image detection tests for digital (left) and printed and scanned images (right). Best results are highlighted in yellow} %&\textls[-15]{
\label{tab:resultsgan}
    \renewcommand\arraystretch{1.5}
    \centering
    \small
\begin{tabular}{|l|l|c|c|c|c|c|c|c|c|c|}
    \hline
    \rowcolor{mygray}
    &   &   & \mcc[4]{\CHead{Digital images\\ testing results}}
                & \mcc[4]{\CHead{Printed and scanned\\
                                 testing images results}}    \\
\hhline{|>{\arrayrulecolor{mygray}}--->{\arrayrulecolor{black}}--------|}
    \rowcolor{mygray}
\multirow{-2}{*}{\CHead{Method}}
    & \multirow{-2}{*}{\CHead{Training/Validation\\ Data}}
        & \multirow{-2}{*}{\CHead{Input\\ Size}}
            & \CHead{Acc}
                & \CHead{F}
                    & \CHead{Precision}
                        & \CHead{Recall}
                            & \CHead{Acc}
                                & \CHead{F}
                                    & \CHead{Precision}
                                        & \CHead{Recall} \\
\hhline{|--->{\arrayrulecolor{black}}------->{\arrayrulecolor{black}}-|}
\cellcolor{myteal}{\textbf{DENSENET} ~\cite{marraetal:2018,HUANGETAL:2017}} 
    & \cellcolor{myteal}{Images Patches} 
        & \num{224x224x3} 
            & \cellcolor{yellow}{1.00} 
                & \cellcolor{yellow}{1.00} 
                    & \cellcolor{yellow}{1.00} 
                        & \cellcolor{yellow}{1.00} 
                            & 0.50 & 0.00 & 0.00 & 0.00 \\
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
\cellcolor{myteal}{\textbf{INCEPTION-V3} ~\cite{marraetal:2018,Szegedyetal:2016}} 
    & \cellcolor{myteal}{Images Patches} 
        & \num{224x224x3} 
            & \cellcolor{yellow}{1.00} 
                & \cellcolor{yellow}{1.00} 
                    & \cellcolor{yellow}{1.00} 
                        & \cellcolor{yellow}{1.00} 
                            & 0.50 & 0.00 & 0.00 & 0.00 \\
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
\cellcolor{myteal}{\textbf{XCEPTION}~\cite{marraetal:2018,chollet:2017}} 
    & \cellcolor{myteal}{Images Patches} 
        & \num{299x299x3} 
            & \cellcolor{yellow}{1.00} 
                & \cellcolor{yellow}{1.00} 
                    & \cellcolor{yellow}{1.00} 
                        & \cellcolor{yellow}{1.00} 
                            & 0.50 & 0.00 & 0.00 & 0.00 \\
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
\cellcolor{myteal}{\textbf{CONET} ~\cite{lakshmananetal:2019}} 
    & \cellcolor{myteal}{Co-occurency Matrices} 
        & \num{256x256x3} 
            & 0.96 & 0.96 & 0.95 & 0.98 & 0.50 & 0.00 & 0.00 & 0.00 \\
\hhline{|>{\arrayrulecolor{black}}-->{\arrayrulecolor{black}}---------|}
\cellcolor{myteal}{\textbf{CROSSCONET}~\cite{barnietal:2020}}
    & \cellcolor{myteal}{Co-occurency Matrices} 
        & \num{256x256x6} 
            & 0.99 & 0.99 & 0.98 & 1.00 & \cellcolor{yellow}{0.50} 
                & \cellcolor{yellow}{0.29}  
                    & \cellcolor{yellow}{0.50} 
                        & \cellcolor{yellow}{0.21} \\
    \hline
\end{tabular}
\end{sidewaystable}
\end{document}

enter image description here

1

Here is a way to construct that tabular with nicematrix (and rotation to landscape mode).

\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{rotating}
\usepackage{xcolor}
\definecolor{mygray}{rgb}{0.863,0.863,0.863}
\definecolor{myteal}{rgb}{0.863,0.941,0.941}
\usepackage[skip=1ex]{caption}
\usepackage{subcaption}
\usepackage{siunitx}
\usepackage{nicematrix}
%

\begin{document}
    \begin{sidewaystable}[ht]
\caption{Results of GAN image detection tests for digital (left) and printed and scanned images (right). Best results are highlighted in yellow}
\label{tab:resultsgan}
    \renewcommand\arraystretch{1.5}
    \centering
    \small
\begin{NiceTabular}{llccccccccc}%
  [
    hvlines,
    code-before = 
      \rowcolor{mygray}{1,2}
      \rectanglecolor{myteal}{3-1}{7-1}
      \rectanglecolor{yellow}{3-4}{5-7}
      \rectanglecolor{yellow}{7-8}{7-11}
  ]
\Block{2-1}{\bfseries Method} & \Block{2-1}<\bfseries>{Training/Validation\\ Data} & \Block{2-1}<\bfseries>{Input\\ Size}
& \Block{1-4}<\bfseries>{Digital images\\ testing results} & & & 
& \Block{1-4}<\bfseries>{Printed and scanned\\ testing images results}   \\
& & & \bfseries Acc & \bfseries F & \bfseries Precision & \bfseries Recall & \bfseries Acc 
& \bfseries F & \bfseries Precision & \bfseries Recall \\
\textbf{DENSENET} ~\cite{marraetal:2018,HUANGETAL:2017}
& Images Patches & \num{224x224x3} & 1.00 & 1.00 & 1.00 & 1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\
\textbf{INCEPTION-V3} ~\cite{marraetal:2018,Szegedyetal:2016}
& Images Patches & \num{224x224x3} & 1.00 & 1.00 & 1.00 & 1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\
\textbf{XCEPTION}~\cite{marraetal:2018,chollet:2017}
& Images Patches & \num{299x299x3} & 1.00 & 1.00 & 1.00 & 1.00 & 0.50 & 0.00 & 0.00 & 0.00 \\
\textbf{CONET} ~\cite{lakshmananetal:2019}
& Co-occurency Matrices & \num{256x256x3} & 0.96 & 0.96 & 0.95 & 0.98 & 0.50 & 0.00 & 0.00 & 0.00 \\
\textbf{CROSSCONET}~\cite{barnietal:2020}
& Co-occurency Matrices & \num{256x256x6} & 0.99 & 0.99 & 0.98 & 1.00 & 0.50 & 0.29 & 0.50 & 0.21 \\
\end{NiceTabular}
\end{sidewaystable}
\end{document}
  • In {NiceTabular} of nicematrix, you can merge cells both horizontally and vertically with the built-in command \Block.

  • The key hvlines draws all the rules, excepted in the blocks (created by \Block).

  • You can color rows, columns and cells with instructions in the code-before (but it's also possible to use a syntax similar to the syntax of colortbl --- the option table of xcolor).

  • The output will be perfect in all the PDF viewers at all levels of zoom.

  • You don't need hhline nor multirow.

However, you need several compilations (because nicematrix uses PGF/Tikz nodes).

Output of the above code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .