색칠된 셀은 선을 제거합니다.

색칠된 셀은 선을 제거합니다.

셀의 위쪽 줄이 제거되어 표의 셀에 색상을 지정하는 데 문제가 있습니다. 이미 \cellcolor및 에 몇 가지 문제가 있다는 것을 알았지 \cline만 에서 작동하는 솔루션을 찾을 수 없었습니다 \multicolumn.

\documentclass{article}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{rotating}       
\usepackage[table]{xcolor}  
\usepackage{siunitx}        

\begin{document}
    \begin{tabular}{|c|c|c|c|c|c|}
        \cline{3-6}
        \multicolumn{2}{c|}{} & \multicolumn{4}{c|}{Anzahl der Nullstellen} \\
        \cline{3-6}
        \multicolumn{2}{c|}{} & 0 & 1 & 2 & 3 \\
        \hline
        \multirow{18}{*}{\rotatebox[origin=c]{90}{Anzahl der Polstellen}} & 1 & $\begin{matrix} \SI{99.9}{\percent} \\ \SI{37.7}{\percent} \\ \SI{43.8}{\percent} \\ \SI{45.1}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.9}{\percent} \\ \SI{41.5}{\percent} \\ \SI{67.5}{\percent} \\ \SI{72.6}{\percent}\end{matrix}$ & \multicolumn{2}{c|}{} \\
        \cline{2-5}
        & 2 & $\begin{matrix} \SI{99.9}{\percent} \\ \SI{72}{\percent} \\ \SI{78.4}{\percent} \\ \SI{77.8}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.9}{\percent} \\ \SI{72.6}{\percent} \\ \SI{92.5}{\percent} \\ \SI{94.4}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.5}{\percent} \\ \SI{72.7}{\percent} \\ \SI{97.2}{\percent} \\ \SI{98.3}{\percent}\end{matrix}$ &  \\
        \cline{2-6}
        & 3 & $\begin{matrix} \SI{98.6}{\percent} \\ \SI{-42.7}{\percent} \\ \SI{95.7}{\percent} \\ \SI{94.2}{\percent}\end{matrix}$ & {\cellcolor{black!25}} $\begin{matrix} \SI{99.9}{\percent} \\ \SI{73.4}{\percent} \\ \SI{99.1}{\percent} \\ \SI{99.3}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.9}{\percent} \\ \SI{-40.1}{\percent} \\ \SI{99.3}{\percent} \\ \SI{96.7}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.7}{\percent} \\ \SI{72.8}{\percent} \\ \SI{99.4}{\percent} \\ \SI{98}{\percent}\end{matrix}$ \\
        \cline{2-6}
        & 4 & $\begin{matrix} \SI{0}{\percent} \\ \SI{67.8}{\percent} \\ \SI{93.2}{\percent} \\ \SI{93}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.5}{\percent} \\ \SI{-23.5}{\percent} \\ \SI{95.4}{\percent} \\ \SI{93}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.9}{\percent} \\ \SI{73.9}{\percent} \\ \SI{5.3}{\percent} \\ \SI{93}{\percent}\end{matrix}$ & $\begin{matrix} \SI{99.9}{\percent} \\ \SI{74}{\percent} \\ \SI{-87.1}{\percent} \\ \SI{96.5}{\percent}\end{matrix}$ \\
        \cline{2-6}
        & 5 & $\begin{matrix} \SI{-99.7}{\percent} \\ \SI{-82.9}{\percent} \\ \SI{-99.4}{\percent} \\ \SI{93}{\percent}\end{matrix}$ & $\begin{matrix} \SI{-99.8}{\percent} \\ \SI{64.9}{\percent} \\ \SI{2.7}{\percent} \\ \SI{93}{\percent}\end{matrix}$ & $\begin{matrix} \SI{-100.5}{\percent} \\ \SI{-69.8}{\percent} \\ \SI{59.1}{\percent} \\ \SI{93}{\percent}\end{matrix}$ & $\begin{matrix} \SI{-0.4}{\percent} \\ \SI{73.9}{\percent} \\ \SI{14.4}{\percent} \\ \SI{93.1}{\percent}\end{matrix}$ \\
        \hline
    \end{tabular}
\end{document}

여기에 문제가 있습니다

그런데 누군가 내가 왜 18을 입력해야 했는지 말해 줄 수 있나요 \multirow?

답변1

@leandris가 주석에서 친절하게 제안했듯이 수평선이 완전히 표시되도록 하려면 (a) 패키지를 로드 hhline하고 (b) \cline{3-6}문제의 지시문을 \hhline{~~----}.

또한 코드를 상당히 단순화할 수도 있습니다. 예를 들어 array환경 대신 환경을 사용하면 tabular모든 기호를 제거할 수 있습니다 $. \SI{...}{...}래퍼 에 백분율 숫자를 넣을 필요는 없습니다 .

(어두운 셀 왼쪽의 "누락된" 수직선은 스크린샷의 저해상도 때문에 발생하는 현상입니다. 일반 PDF 파일에서는 문제 없이 표시됩니다.)

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage{mathtools,hhline}
\usepackage{multirow}
\usepackage{rotating}       
\usepackage[table]{xcolor}    
\usepackage{siunitx}        

\begin{document}
\[
\setlength\extrarowheight{1pt}
\begin{array}{|*{6}{c|}}
\cline{3-6}
\multicolumn{2}{c|}{} 
& \multicolumn{4}{c|}{\text{Anzahl der Nullstellen}} \\
\cline{3-6}
\multicolumn{2}{c|}{} & 0 & 1 & 2 & 3 \\
\hline
\multirow{17}{*}{\rotatebox[origin=c]{90}{Anzahl der Polstellen}} 
& 1 
& \begin{matrix*}[r] \phantom{-}99.9\% \\ 37.7\% \\ 43.8\% \\ 45.1\%\end{matrix*} 
& \begin{matrix*}[r] \phantom{-}99.9\% \\ 41.5\% \\ 67.5\% \\ 72.6\%\end{matrix*} 
& \multicolumn{2}{c|}{} \\
\cline{2-5}    
& 2 
& \begin{matrix*}[r] \phantom{-}99.9\% \\ 72.0\% \\ 78.4\% \\ 77.8\%\end{matrix*} 
& \begin{matrix*}[r] \phantom{-}99.9\% \\ 72.6\% \\ 92.5\% \\ 94.4\%\end{matrix*} 
& \begin{matrix*}[r] \phantom{-1}99.5\% \\ 72.7\% \\ 97.2\% \\ 98.3\%\end{matrix*} 
&  \\
%\cline{2-6}
\hhline{~~----}
& 3 
& \begin{matrix*}[r] 98.6\% \\ -42.7\% \\ 95.7\% \\ 94.2\%\end{matrix*} 
& \cellcolor{black!12} 
  \begin{matrix*}[r] \phantom{-}99.9\% \\ 73.4\% \\ 99.1\% \\ 99.3\%\end{matrix*} 
& \begin{matrix*}[r] \phantom{-1}99.9\% \\ -40.1\% \\ 99.3\% \\ 96.7\%\end{matrix*} 
& \begin{matrix*}[r] \phantom{-}99.7\% \\ 72.8\% \\ 99.4\% \\ 98\%\end{matrix*} \\
\cline{2-6}
& 4 
& \begin{matrix*}[r] 0.0\% \\ \phantom{-}67.8\% \\ 93.2\% \\ 93.0\%\end{matrix*} 
& \begin{matrix*}[r] 99.5\% \\ -23.5\% \\ 95.4\% \\ 93.0\%\end{matrix*} 
& \begin{matrix*}[r] \phantom{-1}99.9\% \\ 73.9\% \\ 5.3\% \\ 93.0\%\end{matrix*} 
& \begin{matrix*}[r] 99.9\% \\ 74\% \\ -87.1\% \\ 96.5\%\end{matrix*} \\
\cline{2-6}
& 5 
& \begin{matrix*}[r] -99.7\% \\ -82.9\% \\ -99.4\% \\ 93.0\%\end{matrix*} 
& \begin{matrix*}[r] -99.8\% \\ 64.9\% \\ 2.7\% \\ 93.0\%\end{matrix*} 
& \begin{matrix*}[r] -100.5\% \\ -69.8\% \\ 59.1\% \\ 93.0\%\end{matrix*} 
& \begin{matrix*}[r] -0.4\% \\ 73.9\% \\ 14.4\% \\ \phantom{-}93.1\%\end{matrix*} \\
\hline
\end{array}
\]
\end{document}

관련 정보