放错位置未对齐

放错位置未对齐

我使用下面的代码创建了一个表格,但在我使用行颜色的行中出现了错位无对齐错误......你能帮我找出问题的原因吗?非常感谢!!Athanasios

\documentclass{memoir}
\usepackage{color}
\usepackage{xcolor}
\usepackage{colortbl}

\begin{document}
\begin{table}[t!]
\caption{Table title.}
\begin{center}
\begin{tabular}{|c|c|c|l|}\hline
{\rowcolor[cmyk]{0.2 0 0 0}}$\xi$&$\zeta$&$\Delta$& Surface \rule[-6pt]{0ex}{4ex}\\\hline
$4$ & $3$ & $\neq 0$ & Surface 1 \\
$4$ & $3$ & $<0$ & Surface 1 \\
$4$ & $3$ & $>0$ & Surface 1 \\
$4$ & $2$ & $<0$ & Surface 1 \\
$4$ & $2$ & $>0$ & Surface 1 \\
$3$ & $3$ & & Surface 1 \\
$3$ & $2$ & & Surface 1 \\
$3$ & $2$ & & Surface 1 \\
$3$ & $1$ & & Surface 1 \\
$2$ & $1$ & & Surface 1 \\
$2$ & $1$ & & Surface 1 \\
$1$ & $1$ & & Surface 1 \\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}

答案1

删除标记行中的一对花括号here即可解决问题:

\documentclass{memoir}
\usepackage{color}
\usepackage{xcolor}
\usepackage{colortbl}

\begin{document}
\begin{table}[t!]
\caption{Table title.}
\begin{center}
\begin{tabular}{|c|c|c|l|}\hline
\rowcolor[cmyk]{0.2 0 0 0}$\xi$&$\zeta$&$\Delta$& Surface \rule[-6pt]{0ex}{4ex}\\\hline % here -- PS
$4$ & $3$ & $\neq 0$ & Surface 1 \\
$4$ & $3$ & $<0$ & Surface 1 \\
$4$ & $3$ & $>0$ & Surface 1 \\
$4$ & $2$ & $<0$ & Surface 1 \\
$4$ & $2$ & $>0$ & Surface 1 \\
$3$ & $3$ & & Surface 1 \\
$3$ & $2$ & & Surface 1 \\
$3$ & $2$ & & Surface 1 \\
$3$ & $1$ & & Surface 1 \\
$2$ & $1$ & & Surface 1 \\
$2$ & $1$ & & Surface 1 \\
$1$ & $1$ & & Surface 1 \\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}

在此处输入图片描述

相关内容