0

I'm trying to align numbers by a decimal point in LaTex. I know this has already been answered, but what I can't figure out is how to center justify the labels around the decimal point.

\begin{tabular}{r@{}l r@{}l}
\hline
\multicolumn{2}{c}{Landings (mton)} & \multicolumn{2}{c}{Landings (mton)} \\
73.&57&877.&36\\
1.&28&5.&19\\
\hline
\end{tabular}
user13317
  • 199
  • 1
    You might want to have a look at this answer which will show you the best way of aligning the columns. If by labels you mean a header row, this could be done but may look odd if your numbers aren't well balanced across the decimal point. – Chris H Jul 13 '15 at 14:05

1 Answers1

2

The package siunitx is made for such things:

% arara: pdflatex

\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}    
\begin{tabular}{S[table-format=2.2]S[table-format=3.2]}
    \toprule
    {Landings (mton)} & {Landings (mton)} \\
    73.57&877.36\\
    1.28&5.19\\
    \bottomrule
\end{tabular}
\end{document}

enter image description here

LaRiFaRi
  • 43,807