Como faço para unir as linhas verticais aqui na tabela?

Como faço para unir as linhas verticais aqui na tabela?

Aqui está o meu código:

\documentclass[letterpaper]{article} % DO NOT CHANGE THIS
\usepackage{times}  % DO NOT CHANGE THIS
\usepackage{helvet} % DO NOT CHANGE THIS
\usepackage{courier}  % DO NOT CHANGE THIS
\usepackage[hyphens]{url}  % DO NOT CHANGE THIS
\usepackage{graphicx} % DO NOT CHANGE THIS
\urlstyle{rm} % DO NOT CHANGE THIS
\def\UrlFont{\rm}  % DO NOT CHANGE THIS
\usepackage{graphicx}  % DO NOT CHANGE THIS
\usepackage{natbib}  % DO NOT CHANGE THIS AND DO NOT ADD ANY OPTIONS TO IT
\usepackage{caption} % DO NOT CHANGE THIS AND DO NOT ADD ANY OPTIONS TO IT
\usepackage{multirow}
\usepackage{makecell}
\usepackage{adjustbox}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{textcomp}
\usepackage{array}
\usepackage{pbox}
\frenchspacing  % DO NOT CHANGE THIS
\setlength{\pdfpagewidth}{8.5in}  % DO NOT CHANGE THIS
\setlength{\pdfpageheight}{11in}  % DO NOT CHANGE THIS
\begin{document}
\begin{table*}[ht]
\centering
\begin{adjustbox}{width=0.9\textwidth}
\begin{tabular}{c|c|cc|cc|cc|c}
\hline
\multirow{4}{*}{Network}  & \multirow{4}{*}{\makecell{Score\\ Type}} & \multicolumn{2}{c}{\multirow{3}{*}{High SNR}} & 
\multicolumn{2}{c}{\multirow{3}{*}{Medium SNR}} &
\multicolumn{2}{c}{\multirow{3}{*}{Low SNR}} &
\multirow{4}{*}{\makecell{Time\\per epoch\\(secs)}}\\ 
\\
& & MAE & PE (\%) & MAE & PE(\%) & MAE & PE(\%) & \\\hline \hline 

\multirow{2}{*}{SVR} 
& R & 8.89$\pm$2.07 & 100$\pm$0.00 &  9.23$\pm$1.85 & 100$\pm$0.00 &  9.70$\pm$1.38 & 100$\pm$0.00 & \multirow{2}{*}{---} \\ 
& E & 9.97$\pm$2.45 & 96.29$\pm$8.30 & 10.08$\pm$2.46 & 96.28$\pm$8.32 & 10.31$\pm$1.56 & 96.40$\pm$8.05 &     \\ \hline 
\multirow{2}{*}{Lasso}                                                         
& R & 18.57$\pm$5.28 & 44.89$\pm$21.06 & 18.56$\pm$5.28 & 44.84$\pm$21.12 & 18.55$\pm$5.24 & 44.85$\pm$21.02 & \multirow{2}{*}{---} \\
& E & 18.60$\pm$3.58 & 43.19$\pm$8.66 &  18.60$\pm$3.57 & 42.95$\pm$8.50 &  18.61$\pm$3.56 & 43.01$\pm$8.61  &     \\ \hline 
\end{tabular}
\end{adjustbox}
\caption{....}
\label{table:tab2}
\end{table*}
\end{document}

Responder1

Aqui estão três exemplos diferentes que mostram como ...

  1. torne seu código compilável,
  2. livrar-se das lacunas nas linhas verticais
  3. encaixe sua mesa no espaço disponível sem usaradjustbox
  4. melhorar o alinhamento dos números dentro da tabela.

Nos dois primeiros exemplos, removi adjustboxe usei uma página paisagem para a tabela larga, enquanto mudei totalmente o layout da tabela no terceiro exemplo. No segundo e terceiro exemplo, removi todas as linhas verticais e substituí as horizontais pelas regras do booktabspacote. Além disso, utilizei o siunitxpacote para melhorar o alinhamento dos números:

insira a descrição da imagem aqui

insira a descrição da imagem aqui

insira a descrição da imagem aqui

\documentclass[letterpaper]{article} % DO NOT CHANGE THIS
\usepackage{times}  % DO NOT CHANGE THIS
\usepackage{helvet} % DO NOT CHANGE THIS
\usepackage{courier}  % DO NOT CHANGE THIS
\usepackage[hyphens]{url}  % DO NOT CHANGE THIS
\usepackage{graphicx} % DO NOT CHANGE THIS
\urlstyle{rm} % DO NOT CHANGE THIS
\def\UrlFont{\rm}  % DO NOT CHANGE THIS
\usepackage{graphicx}  % DO NOT CHANGE THIS
\usepackage{natbib}  % DO NOT CHANGE THIS AND DO NOT ADD ANY OPTIONS TO IT
\usepackage{caption} % DO NOT CHANGE THIS AND DO NOT ADD ANY OPTIONS TO IT
\usepackage{multirow}
\usepackage{makecell}
\usepackage{adjustbox}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{textcomp}
\usepackage{array}
\usepackage{pbox}
\frenchspacing  % DO NOT CHANGE THIS
\setlength{\pdfpagewidth}{8.5in}  % DO NOT CHANGE THIS
\setlength{\pdfpageheight}{11in}  % DO NOT CHANGE THIS

\usepackage{pdflscape}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{landscape}
\begin{table}
\centering
\begin{tabular}{c|c|cc|cc|cc|c}
\hline
\multirow{3}{*}{Network}  & \multirow{3}{*}{\makecell{Score\\ Type}} & \multicolumn{2}{c|}{\multirow{3}{*}{High SNR}} & 
\multicolumn{2}{c|}{\multirow{2}{*}{Medium SNR}} &
\multicolumn{2}{c|}{\multirow{2}{*}{Low SNR}} &
\multirow{3}{*}{\makecell{Time\\per epoch\\(secs)}}\\ 
& & & & &  &  &  &     \\
& & MAE & PE (\%) & MAE & PE(\%) & MAE & PE(\%) & \\\hline \hline 

\multirow{2}{*}{SVR} 
& R & 8.89$\pm$2.07 & 100$\pm$0.00 &  9.23$\pm$1.85 & 100$\pm$0.00 &  9.70$\pm$1.38 & 100$\pm$0.00 & \multirow{2}{*}{---} \\ 
& E & 9.97$\pm$2.45 & 96.29$\pm$8.30 & 10.08$\pm$2.46 & 96.28$\pm$8.32 & 10.31$\pm$1.56 & 96.40$\pm$8.05 &     \\ \hline 
\multirow{2}{*}{Lasso}                                                         
& R & 18.57$\pm$5.28 & 44.89$\pm$21.06 & 18.56$\pm$5.28 & 44.84$\pm$21.12 & 18.55$\pm$5.24 & 44.85$\pm$21.02 & \multirow{2}{*}{---} \\
& E & 18.60$\pm$3.58 & 43.19$\pm$8.66 &  18.60$\pm$3.57 & 42.95$\pm$8.50 &  18.61$\pm$3.56 & 43.01$\pm$8.61  &     \\ \hline 
\end{tabular}
\caption{....}
\label{table:tab2}
\end{table}
\end{landscape}

\begin{landscape}
\begin{table}
\centering
\sisetup{separate-uncertainty=true}
\setlength{\tabcolsep}{5.5pt}
\begin{tabular}{l l *{3}{S[table-format=2.2(3)]S[table-format=3.2(4)]} c}
\toprule
Network  
  & \makecell{Score\\ Type} 
    & \multicolumn{2}{c}{High SNR} 
      & \multicolumn{2}{c}{Medium SNR} 
        & \multicolumn{2}{c}{Low SNR} 
          & \makecell{Time\\per epoch\\(secs)}\\ 
\cmidrule(r){3-4} \cmidrule(lr){5-6} \cmidrule(l){7-8}
&   & {MAE}      & {PE (\%)}   & {MAE}      & {PE(\%)}    & {MAE}      & {PE(\%)}   & \\
\midrule
SVR 
& R & 8.89(207)  & 100(0)      &  9.23(185) & 100(0)      &  9.70(138) & 100(0)     & --- \\ 
& E & 9.97(245)  & 96.29(830)  & 10.08(246) & 96.28(832)  & 10.31(156) & 96.40(805) & --- \\
\midrule 
Lasso                                                        
& R & 18.57(528) & 44.89(2106) & 18.56(528) & 44.84(2112) & 18.55(524) & 44.85(2102) & --- \\
& E & 18.60(358) & 43.19(866)  & 18.60(357) & 42.95(850)  &  18.61(356) & 43.01(861) & --- \\ 
\bottomrule 
\end{tabular}
\caption{....}
\label{table:tab2}
\end{table}
\end{landscape}


\begin{table}
\centering
\sisetup{separate-uncertainty=true}
\setlength{\tabcolsep}{5.5pt}
\begin{tabular}{l l S[table-format=2.2(3)]S[table-format=3.2(4)] c}
\toprule
Network 
  & \multirow{2}{*}{\makecell{Score\\ Type}}
    & \multicolumn{2}{c}{High SNR}
          & \multirow{2}{*}{\makecell{Time per \\epoch (secs)}}\\ 
\cmidrule(r){3-4} 
&   & {MAE}      & {PE (\%)}    \\
\midrule
SVR 
& R & 8.89(207)  & 100(0)       & --- \\ 
& E & 9.97(245)  & 96.29(830)   & --- \\
\addlinespace
Lasso                                                        
& R & 18.57(528) & 44.89(2106)  & --- \\
& E & 18.60(358) & 43.19(866)   & --- \\ 
\midrule
Network 
  & \multirow{2}{*}{\makecell{Score\\ Type}}
    & \multicolumn{2}{c}{Medium SNR}
          & \multirow{2}{*}{\makecell{Time per \\epoch (secs)}}\\ 
\cmidrule(r){3-4} 
&   & {MAE}      & {PE (\%)}    \\
\midrule
SVR 
& R  &  9.23(185) & 100(0)      & --- \\ 
& E  & 10.08(246) & 96.28(832)  & --- \\
\addlinespace
Lass                            
& R  & 18.56(528) & 44.84(2112)  & --- \\
& E  & 18.60(357) & 42.95(850)   & --- \\ 
\midrule
Network 
  & \multirow{2}{*}{\makecell{Score\\ Type}}
    & \multicolumn{2}{c}{Low SNR}
          & \multirow{2}{*}{\makecell{Time per \\epoch (secs)}}\\ 
\cmidrule(r){3-4} 
&   & {MAE}      & {PE (\%)}    \\
\midrule
SVR 
& R  &  9.70(138) & 100(0)     & --- \\ 
& E  & 10.31(156) & 96.40(805) & --- \\
\addlinespace
Lass    
& R  & 18.55(524) & 44.85(2102) & --- \\
& E  &  18.61(356) & 43.01(861) & --- \\ 
\midrule
\end{tabular}
\caption{....}
\label{table:tab2}
\end{table}
\end{document}

Responder2

Você não indicou a largura das margens do seu documento. Supondo que eles tenham cerca de 1 "de largura cada, é realmente possível compor a mesa no modo retratosemter que recorrer ao \adjustboxporrete.

Como o seu documento emprega o timespacote de fontes de texto, gostaria de encorajá-lo fortemente a usar um pacote de fontes matemáticas Times Roman; um desses pacotes é newtxmath.

Eu também gostaria de encorajá-lo a dar uma "aparência" muito mais aberta à mesa, principalmente eliminando todas as regras verticais e usando menos regras horizontais, mas bem espaçadas, usando as macros de desenho de linha do booktabspacote.

insira a descrição da imagem aqui


Apenas para demonstrar os efeitos mais infelizes que o uso \adjustboxpode ter nas tabelas, aqui está uma captura de tela da tabela produzida pelo seu código original. Observe, em particular, a grande disparidade nos tamanhos das fontes do corpo da tabela, por um lado, e da legenda, por outro.

insira a descrição da imagem aqui


Finalmente, aqui está o código que produziu a primeira captura de tela.

\documentclass[letterpaper]{article}
\usepackage{amsmath,booktabs,multirow,makecell}
\usepackage[margin=1in]{geometry} % set margins as needed
\usepackage{times,newtxmath} % use a Times Roman math font
\usepackage{array}
\newcolumntype{C}{>{$}c<{$}}
\newcommand\x[1][1]{\phantom{#1}} % for spacing adjustments
\newcommand\px{\mathord{\pm}} % "\pm" but without the spacing
\begin{document}
\begin{table}[ht]
\setlength\tabcolsep{0pt}## Heading ##
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} 
           l c *{6}{C} c }
\toprule
Network 
  & \makecell{Score\\Type} 
  & \multicolumn{2}{c}{High SNR} 
  & \multicolumn{2}{c}{Medium SNR} 
  & \multicolumn{2}{c}{Low SNR} 
  & \makecell{Time\\per epoch}\\ 
\cmidrule{3-4} \cmidrule{5-6} \cmidrule{7-8}
& & \text{MAE} & \text{PE (\%)} 
  & \text{MAE} & \text{PE (\%)} 
  & \text{MAE} & \text{PE (\%)}  
  & (secs) \\
\midrule

\multirow{2}{*}{SVR} 
& R & \x8.89\px2.07      & \x[1.]100\px\x0.00 & \x9.23\px1.85 
    & \x[1.]100\px\x0.00 & \x9.70\px1.38      & \x[1.]100\px\x0.00 
    & \multirow{2}{*}{--} \\ 
& E & \x9.97\px2.45      & 96.29\px\x8.30     & 10.08\px2.46 
    & 96.28\px\x8.32     & 10.31\px1.56       & 96.40\px\x8.05 & \\ 
\addlinespace
\multirow{2}{*}{Lasso}                                                         
& R & 18.57\px5.28       & 44.89\px21.06      & 18.56\px5.28 
    & 44.84\px21.12      & 18.55\px5.24       & 44.85\px21.02 
    & \multirow{2}{*}{--} \\
& E & 18.60\px3.58       & 43.19\px\x8.66     &  18.60\px3.57 
    & 42.95\px\x8.50     &  18.61\px3.56      & 43.01\px\x8.61 & \\ 
\bottomrule
\end{tabular*} 
\caption{\dots}
\label{table:tab2}
\end{table}
\end{document}

informação relacionada