I have a table listing several properties. Some of them have a unit some don't. All have a uncertainty. Now I want to align them properly in the table using the siunitx package.
See following MWE:
\documentclass{article}
\usepackage{siunitx}
\sisetup{separate-uncertainty}
\sisetup{multi-part-units=single}
\begin{document}
\begin{tabular}[b]{|l|S|}
\hline
Property & {Value} \\\hline
A & \SI{284.98 \pm 5.2}{\meter} \\\hline
B & \SI{3.86 \pm 0.3}{\kilo\gram} \\\hline
C & \num{96.4 \pm 42.3} \\\hline
\end{tabular}
\end{document}
The problem is, that none of the values are aligned correctly.
Update:
The result should like the following:
A 284.98 +/- 5.2 m
B 3.86 +/- 0.3 kg
C 96.4 +/- 42.3
However, the alignment of the uncertainty is not necessarily required.
Best Answer
In this MWE, I have separated the number and the uncertainty into two columns that are automatically separated by the +- sign. With
table-format=3.2
I can make sure, that the numbers are aligned correctly with respect to the decimal separator. The units are in a third column and left-aligned. Additionally, I have removed all vertical lines and have replaced\hrule
s by the lines of thebooktabs
package.