我有此代码给出一个错误:
\begin{table}
\begin{tabular}{|ccccccccc|}
\hline
\multirow{9}{*}{\textbf{Table Heading}} &
\makecell{8-16-bit\\fixed-point} & 230 & \makecell{HLS} &
\makecell{1682\\1644} & \makecell{5120\\4480} &
\makecell{39\%\\38\%} & \multicolumn{2}{c|}{46\%\\42\%} & \makecell{75\%\\65\%}
\end{tabular}
\end{table}
Line\multicolumn{2}{c|}{46\%\\42\%}
给出有关 \cr 的错误。我确信该错误与在 中使用转义序列有关multicolumn{}{}{\escapesequences}
,正在寻找在多列中使用它们的方法。
答案1
\documentclass{article}
\usepackage{booktabs, makecell, multirow}
\usepackage{siunitx}
\begin{document}
\begin{table}
\begin{tabular}{ *{10}{c} }
\toprule
\multicolumn{9}{c}{\textbf{Table Heading}} \\
\midrule
\makecell[b]{8-16-bit\\fixed-point}
& \makecell[b]{230}
& \makecell[b]{HLS}
& \makecell[b]{1682\\1644}
& \makecell[b]{5120\\4480}
& \makecell[b]{\SI{39}{\%}\\ \SI{38}{\%}}
& \multicolumn{2}{c}{\makecell[b]{\SI{46}{\%}\\ \SI{42}{\%}}} % <---
& \makecell[b]{\SI{75}{\%}\\ \SI{65}{\%}} \\
\midrule
\end{tabular}
\end{table}
\end{document}
给出:
这就是你要找的吗?