[Tex/LaTex] Problem aligning binary and hexadecimal numbers in siunitx table

siunitxtables

Could you tell me what's wrong with next code? I want to get a three columns tabular where numbers are typeset with typewriter family and centred below its header. Numbers won't have any decimal part, they are integers and their decimal, binary and hexadecimal representation.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{siunitx}
\usepackage{booktabs}
\begin{document}

\sisetup{math-rm=\mathtt, 
        group-digits=false, 
        table-figures-decimal=0, 
        table-number-alignment=center,
        input-digits={0123456789ABCDEF}
        }

\begin{tabular}{SS[minimum-integer-digits=8]S}
\toprule
{Decimal} & {Binary} & {Hexadecimal} \\
\midrule
63 & 00111111 & 3F \\
250 & 11111010 & FA \\
117 & 01110101 & 75 \\
220 & 11011100 & DC \\
171 & 10101011 & AB \\
94 & 01011110 & 5E \\
\bottomrule
\end{tabular}
\end{document}

As you can see, second column doesn't have enough space and second and third column are not correctly aligned. What am I misunderstanding in siunitx guide?

enter image description here

Best Answer

The binary numbers in the second column are centered with table-format=8.0. Also the overfull \hbox warnings are gone:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{siunitx}
\usepackage{booktabs}
\begin{document}

\sisetup{math-rm=\mathtt,
        group-digits=false,
        table-figures-decimal=0,
        table-number-alignment=center,
        input-digits={0123456789ABCDEF}
        }

\begin{tabular}{SS[minimum-integer-digits=8,table-format=8.0]S[table-format=2.0]}
\toprule
{Decimal} & {Binary} & {Hexadecimal} \\
\midrule
63 & 00111111 & 3F \\
250 & 11111010 & FA \\
117 & 01110101 & 75 \\
220 & 11011100 & DC \\
171 & 10101011 & AB \\
94 & 01011110 & 5E \\
\bottomrule
\end{tabular}
\end{document}

Result

Related Question