I have a table with decimal numbers aligned at decimal point. In the column header, I have a % sign. In the code snippet given below, the percent sign is aligned at the left in the column, but I would like it to be either aligning with the decimal points or to the right. How can I achieve this?
Current result:
\documentclass[ngerman]{scrbook}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{l S[table-format=3.2]}
\textbf{fruit} & \textbf{\%} \\
apple & 12,34 \\
banana & ,1 \\
cherry & 1,2345 \\
coconut & 100 \\
\end{tabular}
\end{document}
Best Answer
You can align to the right by using
multicolumn
:I have changed
S[table-format=3.2]
toS[table-format=3.4]
so as to compensate for the entry in cherry..