我是 LATEX 和这个论坛的新手。我尝试使用 tabularX 包(唯一允许用于期刊提交的包)制作表格。我制作的表格正确,但由于合并单元格,边框显得脱节。如果有人能/愿意帮助我解决这个问题,我将不胜感激。
\begin{table}[htbp]
\centering
\caption{Summary table}
\begin{tabularx}{\textwidth}{|c|c|c|c|c|c|c|X|c|}
\hline
Region & Variables & \multicolumn{1}{p{7em}|}{XX} & \multicolumn{1}{p{8em}|}{XXXXXXX} & \multicolumn{1}{p{7em}|}{XXXXXXS} & XX & XX & \multicolumn{1}{p{4.13em}|}{XX} \bigstrut\\
\hline
\multirow{4}[8]{*}{AA} & \multirow{2}[4]{*}{TT} & Overall & 0.99 & 0.99 & 1.13 & 0.971 & \multirow{2}[4]{*}{365} \bigstrut\\
\cline{3-7} & & Season & 0.978 & 0.977 & 1.288 & 0.936 & \bigstrut\\
\cline{2-8} & \multirow{2}[4]{*}{PP} & Overall & 0.933 & 0.83 & 2.637 & 0.856 & \multirow{2}[4]{*}{449} \bigstrut\\
\cline{3-7} & & Season & 0.95 & 0.823 & 2.166 & 0.883 & \bigstrut\\
\end{tabularx}%
\hline
\label{tab:krig_sum}
}
\end{table}
答案1
我建议您X
不要只对倒数第二列进行列类型设置,而要对从第 4 列到第 7 列进行列类型设置。我还建议您通过省略所有垂直规则和间距适当的水平规则,使表格具有更加开放和吸引人的“外观”。
\documentclass{article} % or some other suitable document class
\usepackage{tabularx} % for 'tabularx' env. and 'X' column type
\usepackage{ragged2e} % for '\Centering' macro
\usepackage{booktabs} % for \toprule, \midrule, \bottomrule, and \cmidrule macros
\usepackage{multirow} % for \multirow macro
\usepackage{siunitx} % for 'S' column type
\newcolumntype{C}{>{\Centering\hspace{0pt}}X} % centered version of 'X' col. type
\newcommand\mC[1]{\multicolumn{1}{C}{#1}} % handy shortcut macro
\begin{document}
\begin{table}[htbp]
\caption{Summary table\strut} \label{tab:krig_sum}
\begin{tabularx}{\textwidth}{@{} lll *{4}{S[table-format=1.3]} c @{}}
\toprule
Region & Variables & XX &
\mC{XXXX XXX} & \mC{XXXX XXS} & \mC{XX} & \mC{XX} & XX \\
\midrule
\multirow{5.2}{*}{AA}
& \multirow{2.3}{*}{TT} & Overall & 0.99 & 0.99 & 1.13 & 0.971 & \multirow{2.3}{*}{365} \\
\cmidrule(lr){3-7}
& & Season & 0.978 & 0.977 & 1.288 & 0.936 & \\
\cmidrule(l){2-8}
& \multirow{2.3}{*}{PP} & Overall & 0.933 & 0.83 & 2.637 & 0.856 & \multirow{2.3}{*}{449} \\
\cmidrule(lr){3-7}
& & Season & 0.95 & 0.823 & 2.166 & 0.883 & \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}