![表格数组不正确](https://linux22.com/image/261910/%E8%A1%A8%E6%A0%BC%E6%95%B0%E7%BB%84%E4%B8%8D%E6%AD%A3%E7%A1%AE.png)
我想建立一个这样的表格:
我尝试过一个代码但它不能正常工作:
\begin{table}[htp]
\caption{The temporal outlier detection accuracy of hourly mean values with respect to the Mos in 2007-09-30}
\label{tab:todh30}
\centering
\footnotesize\setlength{\tabcolsep}{2.5pt}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
Node ID & \multicolumn{2}{c|}{Density-based} & \multicolumn{2}{c|}{Mahalanobis distance-based} & \multicolumn{2}{c|}{Running average-based} \\
& DR\% & FPR\% & DR\% & FPR\% & DR\% & FPR\% \\ \hline
25 & 100 & 14 & 100 & 14 & 66 & 20 \\ \hline
\end{tabular}
\end{table}
答案1
您在使用 时犯了太多错误\\
,\cline
请\hline
尝试以下操作:
\documentclass{article}
\begin{document}
\begin{table}[htp]
\centering
\footnotesize\setlength{\tabcolsep}{2.5pt}
\renewcommand*{\arraystretch}{1.5}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
Node ID & \multicolumn{2}{c|}{Density-based} & \multicolumn{2}{c|}{Mahalanobis distance-based} & \multicolumn{2}{c|}{Running average-based} \\
\cline{2-7}
& DR\% & FPR\% & DR\% & FPR\% & DR\% & FPR\% \\ \hline
25 & 100 & 71 & 100 & 71 & 100 & 60 \\ \hline
\end{tabular}
\end{table}
\end{document}
另外,发布完整的 MWe(包括等等)总是比较容易documentclass
,就像我做的那样。