0

I am trying to produce a table with the Siunitx package, and to make the text in the header to be left aligned and to start where the numbers begin (see the red line in the attached screenshot).

I have already got an answer for a similar question (see original question), but in the original question only the first column name was long.

MWE:

%:Class
\documentclass[12pt,a4paper]{article}
\usepackage{siunitx}
%:begin
\begin{document}
\begin{table}[htbp]\centering
\sisetup{input-ignore={,}, 
         input-decimal-markers = {.}, 
         group-separator={,}, 
         table-text-alignment = left}
\caption{Descriptive Statistics}
\begin{tabular}{l|S[table-format=1.2]*{2}S[table-format=2.1]}
&{Coefficient}&{Standard deviation}&{Effect on actual score} \\\hline
a&.47&54.5&25.6\\
b&.51&49.2&25.1\\
c&.45&43.7&19.7\\\hline
\end{tabular}
\end{table}
\end{document}

enter image description hereft-alignment-with-siunitx-package-long-column-name?noredirect=1#comment1385299_548451

2
  • For what you like to have, you not need S columns but ordinary l: \begin{tabular}{l| l l}.
    – Zarko
    Jun 9, 2020 at 9:17
  • but what if the length of digits is varying and not symmetric -- 149.2 in the centre instead of just 49.2
    – js bibra
    Jun 9, 2020 at 9:43

0

You must log in to answer this question.

Browse other questions tagged .