![额外的对齐标签已更改为 \cr。\multirow{2}{*} & \multicolumn{4}{l}\textbf](https://linux22.com/image/408068/%E9%A2%9D%E5%A4%96%E7%9A%84%E5%AF%B9%E9%BD%90%E6%A0%87%E7%AD%BE%E5%B7%B2%E6%9B%B4%E6%94%B9%E4%B8%BA%20%5Ccr%E3%80%82%5Cmultirow%7B2%7D%7B*%7D%20%26%20%5Cmulticolumn%7B4%7D%7Bl%7D%5Ctextbf.png)
如何解决上述错误
\begin{table}[]
\begin{center}
\caption{Summary of sample entropy (SPE) features (M $\pm$ std) obtained for three classes. }
\begin{tabular}{llll}
\hline
\vspace{-0.3cm}
\multirow{2}{*} & \multicolumn{4}{l}\textbf{SBs} & \textbf{LRHPT (M $\pm$ Std)} & \textbf{HRHPT (M $\pm$ Std)} & \textbf{HC (M $\pm$ Std)} \\ \hline
\textbf{1} & 0.168$\pm$0.232 & 0.184$\pm$0.261 & 0.541$\pm$ 0.036 \\
\textbf{2} & 1.058$\pm$0.276 & 1.109$\pm$0.192 & 1.389$\pm$0.320 \\
\textbf{3} & 1.112$\pm$0.280 & 1.172$\pm$0.187 & 1.162$\pm$0.253 \\
\textbf{4} & 0.985$\pm$0.214 & 1.029$\pm$0.131& 0.615$\pm$0.252 \\
\textbf{5} & 0.837$\pm$0.168 & 0.860$\pm$0.092 & 0.327$\pm$0.186 \\
\textbf{6} & 0.662$\pm$0.154 & 0.644$\pm$0.129 & 0.222$\pm$0.075\\ \hline
\end{tabular}
\label{fig:SEmeanstd}
\end{center}
\end{table}
答案1
目前还不太清楚最终结果应该是什么样的。
siunitx
我猜你想用“SBs”作为第一列的标题。这是一个使用 和 的修复版本和一个改进版本booktabs
。
\documentclass{article}
\usepackage{siunitx}
\usepackage{caption}
\usepackage{booktabs}
\sisetup{separate-uncertainty}
\begin{document}
\begin{table}[htp]
\centering
\caption{Summary of sample entropy (SPE) features (M $\pm$ std) obtained for three classes. }
\label{fig:SEmeanstd}
\begin{tabular}{llll}
\hline
\textbf{SBs} & \textbf{LRHPT (M $\pm$ Std)} & \textbf{HRHPT (M $\pm$ Std)} & \textbf{HC (M $\pm$ Std)} \\ \hline
\textbf{1} & 0.168$\pm$0.232 & 0.184$\pm$0.261 & 0.541$\pm$ 0.036 \\
\textbf{2} & 1.058$\pm$0.276 & 1.109$\pm$0.192 & 1.389$\pm$0.320 \\
\textbf{3} & 1.112$\pm$0.280 & 1.172$\pm$0.187 & 1.162$\pm$0.253 \\
\textbf{4} & 0.985$\pm$0.214 & 1.029$\pm$0.131& 0.615$\pm$0.252 \\
\textbf{5} & 0.837$\pm$0.168 & 0.860$\pm$0.092 & 0.327$\pm$0.186 \\
\textbf{6} & 0.662$\pm$0.154 & 0.644$\pm$0.129 & 0.222$\pm$0.075\\ \hline
\end{tabular}
\end{table}
\begin{table}[htp]
\centering
\caption{Summary of sample entropy (SPE) features (M $\pm$ Std) obtained for three classes. }
\label{fig:SEmeanstd-SI}
\begin{tabular}{
l
*{3}{S[table-format=1.3(3)]}
}
\toprule
\textbf{SBs} &
{\textbf{LRHPT}} &
{\textbf{HRHPT}} &
{\textbf{HC}}
\\
&
{\textbf{(M $\pm$ Std)}} &
{\textbf{(M $\pm$ Std)}} &
{\textbf{(M $\pm$ Std)}}
\\
\midrule
\textbf{1} & 0.168\pm0.232 & 0.184\pm0.261 & 0.541\pm0.036 \\
\textbf{2} & 1.058\pm0.276 & 1.109\pm0.192 & 1.389\pm0.320 \\
\textbf{3} & 1.112\pm0.280 & 1.172\pm0.187 & 1.162\pm0.253 \\
\textbf{4} & 0.985\pm0.214 & 1.029\pm0.131 & 0.615\pm0.252 \\
\textbf{5} & 0.837\pm0.168 & 0.860\pm0.092 & 0.327\pm0.186 \\
\textbf{6} & 0.662\pm0.154 & 0.644\pm0.129 & 0.222\pm0.075 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
不要使用center
,这会增加垂直空间,但\centering
如图所示。
答案2
我必须承认,我不知道\vspace{-0.3cm}
应\multirow{2}{*} & \multicolumn{4}{l}\textbf{SBs}
该做什么。没有它们,对三个数据列的标题单元格中的材料进行一些重新排列,并将数据列的列类型从更改为l
,c
我得到了以下结果:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}
\centering
\caption{Summary of sample entropy (SPE) features
(M${}\pm{}$Std) obtained for three classes.}
\label{fig:SEmeanstd}
\begin{tabular}{@{}lccc@{}}
\hline
%\vspace{-0.3cm}
%\multirow{2}{*} & \multicolumn{4}{l}\textbf{SBs}
& \textbf{LRHPT} & \textbf{HRHPT} & \textbf{HC} \\
& (M${}\pm{}$Std) & (M${}\pm{}$Std) & (M${}\pm{}$Std) \\
\hline
\textbf{1} & 0.168${}\pm{}$0.232 & 0.184${}\pm{}$0.261 & 0.541${}\pm{}$0.036 \\
\textbf{2} & 1.058${}\pm{}$0.276 & 1.109${}\pm{}$0.192 & 1.389${}\pm{}$0.320 \\
\textbf{3} & 1.112${}\pm{}$0.280 & 1.172${}\pm{}$0.187 & 1.162${}\pm{}$0.253 \\
\textbf{4} & 0.985${}\pm{}$0.214 & 1.029${}\pm{}$0.131& 0.615${}\pm{}$0.252 \\
\textbf{5} & 0.837${}\pm{}$0.168 & 0.860${}\pm{}$0.092 & 0.327${}\pm{}$0.186 \\
\textbf{6} & 0.662${}\pm{}$0.154 & 0.644${}\pm{}$0.129 & 0.222${}\pm{}$0.075\\ \hline
\end{tabular}
\end{table}
\end{document}