I am trying to make some cells bold. Some of the cells may have a trailing asterisk which should also be taken into account. I tried the recommendation in this post, but that does not seem to help much in my case. I am not sure what I am doing wrong here.
As an additional question, I am also wondering whether I can use \sisetup{} for every individual table with different values every time, or whether this command sets the global values. If it sets the global values, how can I make sure that the settings only apply to that table?
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
\usepackage{etoolbox}
\robustify\bfseries
\begin{document}
\begin{table}[hb]
\begin{threeparttable}
\sisetup{table-format=.4,add-integer-zero=false,detect-weight=true,detect-inline-weight=math}
\begin{tabular}{lSSS|SSSS|SS}
\midrule
prof & -.1746* & .1606 & .1240 & .0556 & .1498* & .2858 * & .1204 & .1545* & .1842* \
stud & .0005 & \bfseries{.1918} & .0206 & .0281 & .0647 & \bfseries{.3651} & -.0312 & \bfseries{.1778} & .0992
\end{tabular}
\begin{tablenotes}[flushleft]\item* $p<.05$\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

siunitxpackage documentation :-). Also, you can comment some option and observe difference in result. Optionmode=textmake width of boldface numbers equal to width of the normal numbers (as used in text). – Zarko Jan 19 '21 at 14:45\sisetupin different places for different tables in my document? Or is it a global setup? – Bram Vanroy Jan 19 '21 at 14:46sisetupin preamble, than its settings are global, if you add intablethan valid just for this table (and overwrite global settings). – Zarko Jan 19 '21 at 14:49