2

I have a table with different row sizes and some S[] columns from package siunitx. By default, the numbers in the S columns are vertically centered in each row:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{makecell}

\begin{document}

\begin{tabular}{lS[table-format=2.3]S[table-format=7.1]}
    \multicolumn{1}{l}{Program} &
    \multicolumn{1}{c}{Time [s]}    &
    \multicolumn{1}{c}{Memory [kB]} \\

    \makecell[l]{
    some\\
    multiline\\
    code}   &
    10.0021 &
    61.4    \\

    \makecell[l]{
    more\\
    code}   &
    0.407   &
    11782   \\
\end{tabular}

\end{document}

I would like to align the numbers in the S columns at the bottom of the row instead. How can I do that? I heard of the b{} column, but this seems not be compatible with the horizontal number alignment from siunitx (in addition, I would prefer to not explicitly provide the width for the columns manually). I did not find any hint in the siunitx documentation on how that is possible.

Does someone know a convenient solution for that, maybe by extending the siunitx package? Thanks in advance!

1
  • 3
    S columns align like c or l columns on the text baseline, it is your makecell in column 1 that is vertically centred you want to top align it Jul 7, 2023 at 14:08

1 Answer 1

5

S columns align like c or l columns on the text baseline, it is your \makecell in column 1 that is vertically centred you want to top or bottom align it.

1
  • Ah, seems like I missed some of the basics. So I just needed to change \makecell[l] to \makecell[bl]. Thanks! Jul 7, 2023 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .