I have the following code. As you can see, in the column definition I have put @{} as suggested here
\documentclass[draft]{scrbook}
\usepackage{dcolumn,booktabs}
\begin{document}
\newcolumntype{P}[1]{D{.}{.}{#1}}
\begin{tabular}{ @{} l *{4}{P{3}} @{} }
\toprule
Treatment & \multicolumn{1}{c}{X} & \multicolumn{1}{c}{Y} & \multicolumn{1}{c}{Diff.} & \multicolumn{1}{c}{p-value} \\
\midrule
MgmtInTreated & 0.473 & 0.537 & 0.063 & 0.52\% \\
MgmtOutTreated & 0.505 & 0.443 & -0.062 & 96.67\% \\
\midrule
TecInTreated & 0.482 & 0.535 & 0.053 & 2.45\% \\
TecOutTreated & 0.504 & 0.422 & 0.082 & 98.19\% \\
\midrule
OthInTreated & 0.49 & 0.509 & 0.017 & 28.32\% \\
OthOutTreated & 0.5 & 0.447 & -0.053 & 87.91\% \\
\bottomrule
\end{tabular}
\end{document}
The result is this:
The document is in draft mode, so the black boxes are overfull boxes.
And I get the resulting Overfull box warnings in the logs. Why I get this warning when the table clearly don't exceed the \textwidth, and how can I solve them?
Using tabularx with \textwidth does not help either.


lcan not be overfull as it grows as needed, so since the column type in that column is D..{3} making it wider is what needs to be done. – David Carlisle Dec 01 '17 at 20:44.19%in math mode. – David Carlisle Dec 01 '17 at 21:49