6

I'm trying to center-align the two-line heading of the rightmost column of the following table. Given that I use decimal point alignment, I guess the centre of the headings should be aligned with the decimal point.

alt text

The code I used is below. I put table-text-alignment=center but it doesn't make any difference, as it can be seen.

\begin{table}[htp]
    \centering
    \begin{tabular}{
            @{}
           l
            S[group-separator={,}, group-four-digits=true,table-format=5.0] 
            S[group-separator={,}, group-four-digits=true,table-format=5.0]
            >{\bfseries}S[table-format=3.2, table-text-alignment=center]
            @{}
            }
          \toprule
          \textbf{Product Group} & \textbf{Production Size} & \textbf{Number of Failures} & \textbf{Failure Rates} \\
          & & & \textbf{(per 1,000 items)} \\
          \midrule
          %  \addlinespace
          this is foo1 & 11111 & 1111 & 11.11\\
          this was foo2 & 22222 & 2222 & 222\\
          this will be foo3 & 33333 & 3333 & 3.33\\
          foo4 & 44444 & 4444 & 44.4\\
          foo5 & 55555 & 5555 & 5.5\\
          \bottomrule
    \end{tabular}
\end{table}

I'm not sure what I'm doing wrong.

0

1 Answer 1

7

You have to mask the critical heading cell with an additional set of curly braces.

... & {\textbf{Failure Rates}} \\

You must log in to answer this question.

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