Just for the sake of variety, here's a solution that uses David Carlisle's dcolumn package instead of the siunitx
package. That's not meant to somehow cast shade on the siunitx
package and its S
column type. It's just that the siunitx
package does a great many things in addition to providing the S
column type. If all you require is to align numbers in the data columns on their explicit or implicit decimal markers, you may be equally well served by employing the specialized dcolumn
package.

\documentclass[11pt,a4paper]{article}
\usepackage[left=3cm,right=3cm,top=1cm,bottom=2cm]{geometry}
\usepackage{booktabs}
% new code:
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{@{}c@{}}{#1}} % handy shortcut macro
\begin{document}
\begin{table}[h]
\centering
$\begin{array}{@{}d{1.0}d{4.0}@{}}
\toprule
i & \mc{e_i} \\
\midrule
1&2\\
2&3\\
3&7\\
4&43\\
5&1807
\end{array}$
\end{table}
\end{document}