For this MWE
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\RequirePackage{mathbbol}
\newcommand{\hmmax}{0}
\newcommand{\bmmax}{2}
\RequirePackage{bm}
\RequirePackage[allowlitunits]{siunitx}
\RequirePackage[usenames,dvipsnames,svgnames,table]{xcolor}
\RequirePackage{booktabs}
\RequirePackage{tabu}
\usepackage{diagbox}
\begin{document}
% \newcolumntype Z{X[c]{%
% S[group-four-digits=true,
% round-mode=places,
% round-precision=2,
% round-integer-to-decimal=true,
% per-mode=symbol]
% }}
\newcolumntype{Z}{S[
tight-spacing=true,
round-mode=places,
round-precision=2]}
\begin{tabu} to \textwidth {ZZZZZZ}
\toprule
\rowfont[c]\bfseries
\diagbox[width=8.5em]{method}{missing} & 0\% & 5\% & 10\% & 20\% & 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}
I would like the table to be like this:
- the first column left aligned
- the column headers to be center aligned
- the body columns (0.123456) to be center aligned at the dot with siunitx
- the second column should be half as wide as the following columns
- the first column should be twice as wide as the later columns (and four times as wide as the second column). For that I had tried
X[2]
andX[0.5]
, but I don't manage to transfer this to theZ
columns.
I tried two versions of the definition of Z, but it does not work. How do I do that?