我的多行多列表存在问题。如图所示,第一列上多出了一条水平线。有人能告诉我如何去掉它吗?我在 Latex WikiBooks 中提供的文章的帮助下构建了整个表格。
这是我的代码:
\documentclass[letterpaper, 10 pt, conference]{ieeeconf}
\IEEEoverridecommandlockouts
\overrideIEEEmargins
\usepackage{multirow}
\begin{document}
\maketitle
\thispagestyle{empty}
\pagestyle{empty}
%-----------------------------------------------%
\begin{table}[!t] \label{table:accuracy}
\centering
\caption{Title.}
\begin{tabular}{| c | c | c | c | c |} \cline{1-4}
& \multicolumn{3}{ c| }{A} \\
\hline
\multicolumn{1}{|p{1cm}|}{\centering A= \\ $[B,C]$} & \multirow{2}{*}{C} & \multirow{2} {*}{D} & \multicolumn{1}{|p{1.5cm}|}{\centering E+ \\ F} & \multicolumn{1}{|p{1.8cm}|} {\centering G+\\+H+I} \\
\hline \hline
$[4,1]$ & 30.22\% & 46.67\% & 44.27\% & 30.48\% \\
$[4,2]$ & 76.94\% & 73.27\% & 80.03\% & 38.47\% \\
$[4,3]$ & 55.22\% & 68.75\% & 71.66\% & 57.29\% \\
$[4,4]$ & 98.98\% & 79.52\% & 82.59\% & 21.84\% \\
$[5,2]$ & 36.94\% & 56.48\% & 63.25\% & 47.40\% \\
$[5,3]$ & 63.99\% & 53.30\% & 51.70\% & 59.32\% \\
$[5,4]$ & 46.46\% & 39.06\% & 39.94\% & 59.91\% \\
$[6,4]$ & 96.80\% & 96.80\% & 100\% & 98.17\% \\
\hline
\multicolumn{1}{|p{1cm}|}{\centering R \\ S} & \multirow{2}{*}{56.37\%} & \multirow{2}{*}{58.33\%} & \multirow{2}{*}{\textbf{60.15\%}} & \multirow{2}{*}{\textbf{51.76\%}} \\
\hline
\end{tabular}
\end{table}
\end{document}
上面的图显示了它现在的情况以及我希望它变成的样子:
答案1
您的列数不正确\cline
(也不要使用\label
之前\caption
。我使用了标准article
,因为我没有您使用的会议类
\documentclass[letterpaper, 10 pt, conference]{article}
\usepackage{multirow}
\begin{document}
\thispagestyle{empty}
\pagestyle{empty}
%-----------------------------------------------%
\begin{table}
\centering
\caption{Title.}\label{table:accuracy}
\smallskip
\begin{tabular}{| c | c | c | c | c |} \cline{2-4}
\multicolumn{1}{c|}{}
& \multicolumn{3}{ c| }{A} \\
\hline
\multicolumn{1}{|p{1cm}|}{\centering A= \\ $[B,C]$} & \multirow{2}{*}{C} & \multirow{2} {*}{D} & \multicolumn{1}{|p{1.5cm}|}{\centering E+ \\ F} & \multicolumn{1}{|p{1.8cm}|} {\centering G+\\+H+I} \\
\hline \hline
$[4,1]$ & 30.22\% & 46.67\% & 44.27\% & 30.48\% \\
$[4,2]$ & 76.94\% & 73.27\% & 80.03\% & 38.47\% \\
$[4,3]$ & 55.22\% & 68.75\% & 71.66\% & 57.29\% \\
$[4,4]$ & 98.98\% & 79.52\% & 82.59\% & 21.84\% \\
$[5,2]$ & 36.94\% & 56.48\% & 63.25\% & 47.40\% \\
$[5,3]$ & 63.99\% & 53.30\% & 51.70\% & 59.32\% \\
$[5,4]$ & 46.46\% & 39.06\% & 39.94\% & 59.91\% \\
$[6,4]$ & 96.80\% & 96.80\% & 100\% & 98.17\% \\
\hline
\multicolumn{1}{|p{1cm}|}{\centering R \\ S} & \multirow{2}{*}{56.37\%} & \multirow{2}{*}{58.33\%} & \multirow{2}{*}{\textbf{60.15\%}} & \multirow{2}{*}{\textbf{51.76\%}} \\
\hline
\end{tabular}
\end{table}
\end{document}