3

I have a table with multiple columns that I have aligned with the S column type from siuntx. In each column I want to mark some special values in a clear and subtle way, I've used the * symbol for that. The problem is that two of the columns contain numbers with only one decimal value and the rest with two decimal values. When compiling the * symbol is not aligned next to the number as this picture shows:

my table

I've tried using bold type for marking but that smashed the horizontal alignment completely. I also cannot just add some 0s to the shorter columns for scientific reasons. What can I do to fix this? Here's my MWE:

    \documentclass[10pt,a4paper]{article}
\usepackage{booktabs}
\usepackage{textcomp}
\usepackage{siunitx}
\usepackage{pgfplotstable}


\begin{document}

\begin{table}
        \centering
        \caption{some table}
        \begin{tabular}{lSSSSSS}\toprule
            Probe & {Ti} & {Al} & {N} & {O} & {H} & {C} \\\midrule
            AAV-1   &21.4   &28.1   &49.2   &0.60*  &0.62*  &0.00    \\
            AAV-2   &21.4   &28.5   &49.0   &0.66*  &0.47   &0.00    \\
            AAV-3   &21.4   &28.9   &49.3   &0.34   &0.04*  &0.00    \\
            AAV-4   &21.5*  &29.1   &49.0*  &0.30*  &0.12   &0.00    \\
            AAV-4-1 &22.1*  &27.4*  &48.3*  &1.32   &0.84*  &0.00    \\
            AAV-5   &20.2*  &29.3   &49.2   &0.73   &0.58   &0.00    \\
            AAV-6   &20.6*  &29.3*  &48.6   &0.74   &0.33   &0.34    \\
            AAV-7   &20.6   &28.9*  &49.8   &0.53*  &0.24   &0.00    \\
            \bottomrule
        \end {tabular}\par
\end{table}

\end{document}
2

You can specify the format of the numbers in the columns:

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage{booktabs}
\usepackage{textcomp}
\usepackage{siunitx}
\usepackage{pgfplotstable}


\begin{document}

\begin{table}
        \centering
        \caption{some table}
        \begin{tabular}{l *{3}{S[table-format=2.1]} *{3}{S[table-format=1.2]}}\toprule
            Probe & {Ti} & {Al} & {N} & {O} & {H} & {C} \\\midrule
            AAV-1   &21.4   &28.1   &49.2   &0.60*  &0.62*  &0.00    \\
            AAV-2   &21.4   &28.5   &49.0   &0.66*  &0.47   &0.00    \\
            AAV-3   &21.4   &28.9   &49.3   &0.34   &0.04*  &0.00    \\
            AAV-4   &21.5*  &29.1   &49.0*  &0.30*  &0.12   &0.00    \\
            AAV-4-1 &22.1*  &27.4*  &48.3*  &1.32   &0.84*  &0.00    \\
            AAV-5   &20.2*  &29.3   &49.2   &0.73   &0.58   &0.00    \\
            AAV-6   &20.6*  &29.3*  &48.6   &0.74   &0.33   &0.34    \\
            AAV-7   &20.6   &28.9*  &49.8   &0.53*  &0.24   &0.00    \\
            \bottomrule
        \end {tabular}\par
\end{table}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.