why is the fourth column not centered?
How to fix that with keeping the style?
\documentclass[12pt,oneside,ngerman,reqno,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsthm} % ams stuff should be before font loading
\usepackage{lmodern}
\usepackage[T1]{fontenc} % should be after font loading
\usepackage{fixltx2e,babel}
\usepackage[numbers]{natbib} % bibtex package
%\usepackage{typearea} % custom type area
% \areaset[0mm]{135mm}{210mm} % typearea configuration
% \topmargin5mm % typearea configuration
\usepackage{graphicx}
\usepackage{url}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{subfig}
\usepackage{pgfplots}
\usepackage{floatrow}
\usepackage{hhline, array, makecell}
\setcellgapes{4pt}
\makegapedcells
%\usepackage[showframe, margin = 25mm]{geometry}
\usepackage{siunitx}
\newcolumntype{I}{S[table-format=4.0]}
\begin{document}
\begin{tabular}{@{}I|I|I|I|S[table-format = 2.2]@{}}
{Züge\,[\#]} & {Planungsintervall\,[min]} & {Zeit\,[s]} &{ Lücke\,[\%]} & {Verbesserung\,[MW]} \\
\hhline{ >{\arrayrulewidth = 2pt}:=:=:=:=:=:}
10 & 28 & 25 & 0.00 & 2.05\\
20 & 36 & 12 & 0.00 & 2.79 \\
50 & 68 & 333 & 0.00 & 1.92 \\
100 & 122 & 1800 & 1.92 & 2.09\\
200 & 127 & 1800 & 1.08 & 3.94 \\
500 & 149 & 1800 & 21.37 & 0.00 \\
1000 & 346 & 509 & 0.00 & 3.00\\
2000 & 460 & 1514 & 0.00 & 3.06\\
\hhline{ >{\arrayrulewidth = 2pt}:=:=:=:=:=:}
\O & & 974 & 3.04 & 2.36 \\ \hline
\Xhline{0.8pt}
\end{tabular}
\end{document}
Best Answer
Several of the columns had incorrect
table-format
s for the data they contained, which causes them to appear un-centered.A solution with more canonical usage of
booktabs
andsiunitx
. I've slightly adjusted the value of\tabcolsep
so the table fits inside the text width.