本表中的多行文本与行线重叠

本表中的多行文本与行线重叠

为什么没有画出边缘?如何解决?

在此处输入图片描述

我想要完整的表格:

在此处输入图片描述

 \documentclass[12pt]{article}  
\usepackage{multirow}
\usepackage{multicol}
\usepackage{copyrightbox}
    %https://tex.stackexchange.com/questions/65604/hhline-adds-white-line-where-no-line-is-intended
\usepackage{colortbl}
\usepackage{hhline}
    \begin{document}
    \begin{table}
      \centering
        \copyrightbox[b]{
          \begin{tabular}{|p{25mm}|c|c|c|c|}
            \hhline{*{3}{|-}|~|}
            technique & \multicolumn{2}{c|}{aaaaa}\\
            \hhline{*{3}{|-}|~|}

             %I dont yet know how to do it locally, so modiying the multirow color globally and then redefining it.
            \hhline{|>{\arrayrulecolor{cyan}}->{\arrayrulecolor{black}}|-|-|}
             \multirow{-2}{=}{{\cellcolor{cyan}1}}& {\cellcolor{cyan}1e-1} & {\cellcolor{cyan}1e-2}  & {\cellcolor{cyan}1e-2}  \\
             \multirow{-2}{=}{{2}}& {1e-1} & {1e-2}  & {1e-2}  \\
            \hhline{*{3}{|-}|~|}
            \multirow{-2}{=}{{3}}& {1e-1} & {1e-2}  & {1e-2}  \\
            \hhline{*{3}{|-}|~|}
            \multirow{-2}{=}{{4}}& {1e-1} & {1e-2}  & {1e-2}  \\
            \hhline{*{3}{|-}|~|}
            \multirow{-2}{=}{{5}}& {1e-1} & {1e-2}  & {1e-2}  \\
            \hhline{*{3}{|-}|~|}

    % etc. ...
          \end{tabular}   
        }{copyright info text}
    \end{table} 
    \end{document}

答案1

我希望我正确理解了你的需求。

\documentclass[]{article}
\usepackage[table]{xcolor}

\begin{document}
\begin{tabular}[]{|p{25mm}|c|c|c|}
  \hline
  technique & \multicolumn{3}{c|}{aaaaa} \\
  \hline
  \rowcolor{cyan}
  1 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  2 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  3 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  4 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  5 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
\end{tabular}
\end{document}

在此处输入图片描述

垂直放大表格的最简单方法是重新定义\arraystretch为大于 1 的值(\begingroup\endgroup添加以保持局部更改):

\documentclass[border=2mm]{standalone}
\usepackage[table]{xcolor}

\begin{document}
\begingroup
\def\arraystretch{1.2}%
\begin{tabular}[]{|p{25mm}|c|c|c|}
  \hline
  technique & \multicolumn{3}{c|}{aaaaa} \\
  \hline
  \rowcolor{cyan}
  1 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  2 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  3 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  4 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
  5 & 1e-1 & 1e-2 & 1e-2 \\
  \hline
\end{tabular}
\endgroup
\end{document}

答案2

尝试这个

\documentclass[12pt]{article}  
\usepackage{copyrightbox}
%https://tex.stackexchange.com/questions/65604/hhline-adds-white-line-where-no-line-is-intended
\usepackage{colortbl}
\begin{document}
    \begin{table}
        \centering
        \copyrightbox[b]{
            \begin{tabular}{|p{25mm}|c|c|c|}
                \hline
                technique & \multicolumn{3}{c|}{aaaaa}\\
                \hline
                {\cellcolor{cyan}x}& {\cellcolor{cyan}Margen C} &  {\cellcolor{cyan}Gamma}&{\cellcolor{cyan}y}\\
                \hline
                OC-SVM & Margen C & Gamma&1\\\hline
                OC-SVM& 1e-1 & 1e-2 &2 \\
                \hline
                RNA & Lr & error&3\\\hline
                OC-SVM& 0.9 & 0.0001&3  \\
                \hline
                % etc. ...
            \end{tabular}   
        }{copyright info text}
    \end{table} 
\end{document}

这将为你带来:

在此处输入图片描述

每个人都是初学者,最好先阅读手册(大多数答案都在那里)。这是我最近学到的东西 ;)

相关内容