这是我之前问过的问题。
我创建了下表:
使用此代码:
\documentclass[border = 6pt]{standalone}
\usepackage{multicol, makecell}
\usepackage{multirow, hhline}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\usepackage[table]{xcolor}
\usepackage{siunitx}
\begin{document}
\sisetup{table-format=-1.1, table-number-alignment=center, table-column-width=1.25cm}
\def\arraystretch{1.5}
\begin{tabular}{L{5.75cm}|S[table-format=3.2]|*{5}{S|}S}
\multicolumn{8}{l}{\textbf{Table 2: GDP by Economic Activity (at constant 2015 prices)}} \\
\hline\hline
& {\multirowcell{3}{2019 \\ share \\ \%}} & \multicolumn{6}{c}{Annual growth, \%} \\
\hhline{~~------}
& & \multicolumn{2}{c|}{2018} & \multicolumn{4}{c}{\cellcolor{blue!10!white} 2019} \\
\hhline{~~------}
& & {3Q} & {4Q} & {1Q} & {2Q} & {3Q} & {\cellcolor{blue!10!white} 4Q} \\
\hline
Services & 57.7 & 7.3 & 6.9 & & & & \cellcolor{blue!10!white} \\
Manufacturing & 22.3 & 5.0 & 4.7 & & & & \cellcolor{blue!10!white} \\
Mining & 7.1 & 5.7 & 0.7 & & & & \cellcolor{blue!10!white} \\
Agriculture & 7.1 & 0.8 & 0.1 & & & & \cellcolor{blue!10!white} \\
Construction & 4.7 & 4.7 & 2.6& & & & \cellcolor{blue!10!white} \\ \hline
Real GDP$^1$ & 100.0 & 4.4 & 4.7 & & & & \cellcolor{blue!10!white} \\ \hline
\multicolumn{4}{@{}l}{\small $^1$Shares do not add up due to rounding and exclusion of import duties.}
& \multicolumn{4}{r@{}}{\small Source: Department of Statistics Malaysia} \\ \hline
\end{tabular}
\end{document}
如果您注意到,第 3 列和第 4 列(标题为 2018 年的 3Q 和 4Q)中的数字并不居中,尽管这些数字都不是负数(这就是上一个问题偏离中心的原因)。
为什么会发生这种情况?我该如何解决?