我有一张桌子,我想把它放在纸上,但左边没有关闭。有人能帮忙吗?另外,桌子中间有一个小缝隙,我想把它去掉,如果有人能帮忙的话,我将不胜感激
\begin{table}[ht]
\caption{Tabulated results}
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{2}{c|}{Channel}& Channel this is \\
\hline
\multicolumn{2}{c}{\multirow{K O}}&
K1\\
\multicolumn{2}{cl}{}&$K2$\\
\hline
\multirow{1Q}&H& r1$\\
&H2& r2\\
&N& r3\\
&X& $X_{x}$\\
&X& $X_{y}$\\
\hline
\hline
\multirow{2q}&H& r1\\
&H& r2 \\
&N& r3\\
&H3& r4\\
&X& $X_X$\\
&X& $X_Y$\\
&X& $X_Z$\\
\hline
DD& rd \\
\hline
\end{tabular}
\end{center}
\label{tab:multicol}
\end{table}
任何帮助将不胜感激
答案1
您的表格有很多错误,不仅仅是@David Carlisle 在评论中指出的错误:
- \multirow 语法错误,
- 遗漏了(未配对)一个
$
,不清楚是否遗漏了其他单元格内容(r2
等r2
) \multicolumn
命令中缺少垂直线- 正确的文档示例(MWE:最小工作示例)是:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}[ht]
\caption{Tabulated results}
\label{tab:multicol}
\centering
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{2}{|c|}{Channel} & Channel this is \\
\hline
\multicolumn{2}{|c|}{%
\multirow{2}{*}{K O}} & K1 \\
\multicolumn{2}{|c|}{} & $K2$ \\
\hline
\multirow{5}{*}{1Q} & H & $r1$ \\
& H2 & r2 \\
& N & r3 \\
& X & $X_{x}$ \\
& X & $X_{y}$ \\
\hline
\hline
\multirow{7}{*}{2q} & H & r1 \\
& H & r2 \\
& N & r3 \\
& H3 & r4 \\
& X & $X_X$ \\
& X & $X_Y$ \\
& X & $X_Z$ \\
\hline
DD & rd & \\
\hline
\end{tabular}
\end{table}
\end{document}