\documentclass{article}
\begin{document}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
Type of Variation & C& B\\
\hline \hline
SNP &
\begin{center}
\begin{tabular}[t]{cccc}
\centering
1&2&3&4\\ A&C&G&T\\ A&T&G&T
\end{tabular}
\end{center}\\ &&
\begin{center}
\begin{tabular}[t]{ccc}
POS & REF & ALT\\
2 & C & T \\
\end{tabular}
\end{center}\\ \hline
\end{tabular}
\end{center}
\end{table}
\end{document}
答案1
我懷疑以下內容可能是您正在尋找的內容。觀察到所有環境都已被刪除,緊鄰最外層環境之前提供了center
一條指令,提供了缺少的指令,並且外部環境中的列數從 4 減少到 3。\centering
tabular
\begin{table}
tabular
\documentclass{article}
\usepackage{array} % for "\extrarowheight" macro
\usepackage[skip=0.333\baselineskip]{caption}
\begin{document}
\begin{table}
\setlength\extrarowheight{2pt} % for a slightly more open "look"
\centering
\caption{Nested \texttt{tabular} environments}
\begin{tabular}{|c|c|c|}
\hline
Type of Variation & C & B \\
\hline \hline
SNP &
\begin{tabular}[t]{@{}cccc@{}} % "@{}" omits side padding
1&2&3&4 \\
A&C&G&T \\
A&T&G&T \\
\end{tabular} &
\begin{tabular}[t]{@{}ccc@{}}
POS & REF & ALT\\
2 & C & T \\
\end{tabular} \\
\hline
\end{tabular}
\end{table}
\end{document}