You have to remove the braces in the title row spanning multiple columns:
\rowfont\bfseries {Element} & {wt\%} & {Isotopic Abundance} \\[0.20em]
Like this?
Edit:
From given MWE I assumed, that the table had to have width of \textwidth
and columns had to be in ratio 4:1:2. This can be achieved on two ways:
superimpose column type p{<width>}
to S
column type. This can be done by use of \multicolumn{1}{>{\centering\arraybackslash}p{<width>}{...}
for column heaser. <width>
is calculated from \textwidth
considering width ratio of columns (first more complicated solution) with
\newlength\colwidth
<-- new length used for determining column widths
\setlength\colwidth{\dimexpr0.077\linewidth-\tabcolsep+\arrayrulewidth\relax}
<-- calculation of base column width
Base width is in p{<width>}
multiplied according to desired ratio of columns widths
determine S
columns width with option `table-column-width= where the base column width is calculated on the same way as above (second example)
First solution:
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\RequirePackage{mathbbol}
\newcommand{\hmmax}{0}
\newcommand{\bmmax}{2}
\usepackage{bm}
\usepackage[allowlitunits]{siunitx}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{booktabs,tabu}
\usepackage{diagbox}
\newcolumntype{Z}{S[
table-format=1.2,% added
%tight-spacing=true,
round-mode=places,
round-precision=2]}
\newlength\colwidth% added
\setlength\colwidth{\dimexpr0.077\linewidth-\tabcolsep+\arrayrulewidth\relax}% added
\newcommand\mcp[2]{\multicolumn{1}{>{\centering\arraybackslash}p{#1\colwidth}}{#2}}% added
\begin{document}
\noindent
\begin{tabu} to \textwidth {p{4\colwidth} *{5}{Z}}% changed
\toprule
\rowfont[c]\bfseries
\diagbox[width=4\colwidth]{method}{missing} % changed
& \mcp{1}{0\%}
&\mcp{2}{5\%} & \mcp{2}{10\%}
& \mcp{2}{20\%}
& \mcp{2}{50\%} \\ % changed
\midrule
KNN & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
MICE & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
SimpleFill & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
SoftImpute & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
\bottomrule
\end{tabu}
\end{document}
Second solution, where had not be used tabu
macro \rowfont[c]\bfseries
due to incompatibility with S
type headers and therefore columns headers are not in bold face:
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\RequirePackage{mathbbol}
\newcommand{\hmmax}{0}
\newcommand{\bmmax}{2}
\usepackage{bm}
\usepackage[allowlitunits]{siunitx}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{booktabs,tabu}
\usepackage{diagbox}
\newlength\colwidth% added
\setlength\colwidth{\dimexpr0.077\linewidth-\tabcolsep+\arrayrulewidth\relax}% added
\begin{document}
\noindent
\begin{tabu} to \textwidth {X % changed
S[table-column-width=\colwidth,% added
table-format=1.1]% added
*{4}{S[table-column-width=2\colwidth,% added
table-format=1.2,% added
round-mode=places,
round-precision=2]}
}
\toprule
%\rowfont[c]\bfseries
\diagbox[width=4\colwidth]{method}{missing}
& \SI{0}{\%} & \SI{5}{\%} & \SI{10}{\%} & \SI{20}{\%} & \SI{50}{\%} \\
\midrule
KNN & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
MICE & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
SimpleFill & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
SoftImpute & 0.0 & 0.123456 & 0.123456 & 0.123456 & 0.123456 \\
\bottomrule
\end{tabu}
\end{document}
Best Answer
(red lines shows text borders)
Instead tabu rather use new table package
tabularray
: