[Tex/LaTex] Horizontal shift in tabular environment

horizontal alignmenttables

My question is the most efficient way to do in tabular environment the last row of the table in the image below. Numbers are shifted horizontally by an half column.
thankyou!
enter image description here

Best Answer

Here's a solution that uses the S column type (provided by the siunitx package) to assure that the numeric-data columns are all equally wide. I also suggesting using the \midrule macro (from the booktabs package), instead of \hline, to get well-spaced horizontal rules.

enter image description here

\documentclass{article}
\usepackage{booktabs} % for \midrule macro
\usepackage{siunitx}  % for 'S' column type
\begin{document}

\begin{table}
\centering
\sisetup{table-format=-1.0}
\setlength\arraycolsep{2pt} % default value: 5pt
$\begin{array}{l @{\quad} *{19}{S} }
K & 0 && 1 && 2 && 3 && 4 && 5 && 6 && 7 && 8 && 9\\
\midrule
y_K & 2 && 3 && 5 && 8 && 9 && 9 && 8 && 7 && 7 && 6\\
\midrule
\Delta y_K && 1 && 2 && 3 && 1 && 0 && -1 && -1 && 0 && -1\\
\end{array}$
\end{table}
\end{document}