I can't wrap my head around multicolumns in latex.
\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\usepackage{siunitx}
\usepackage{rotating}
\usepackage[colorlinks]{hyperref}
\sisetup{
% insert global siunitx settings here
separate-uncertainty=true,
group-digits=false,
round-pad=false,
table-auto-round=true,
group-separator={},
}
\newcolumntype{T}{S[table-format=2.1]}
\newcolumntype{U}{S[table-format=1.5(1)]}
\begin{document}
\begin{tabular}{ S TT UUUU }
\toprule
\multicolumn{2}{c}{\textbf{Mass fraction}, \textbf{Concentration}, \textbf{Density relative to \qty{4}{\degreeCelsius} water}} & \
\multicolumn{4}{c}{(\unit{\percent}) Volume (\unit{\percent}) Mass (\unit{\gram}/(\qty{100}{\mL}))
\qty{10}{\degreeCelsius} \qty{20}{\degreeCelsius} \qty{25}{\degreeCelsius} \qty{30}{\degreeCelsius}} \
0 & 0 & 0 & 0.99973(2) & 0.99823(1) & 0.99708(3) & 0.99568(1) \
4.0 & 5.00 & 3.97 & 0.99258(1) & 0.99103(2) & 0.98984(2) & 0.98839(2) \
10.0 & 12.40 & 9.84 & 0.98393(2) & 0.98187(1) & 0.98043(2) & 0.97875(2) \
18.0 & 22.10 & 17.54 & 0.97473(1) & 0.97129(2) & 0.96923(1) & 0.96697(1) \
25.0 & 30.40 & 24.12 & 0.96665(2) & 0.96168(3) & 0.95895(2) & 0.95607(3) \
28.0 & 33.90 & 26.90 & 0.96268(3) & 0.95710(1) & 0.95410(3) & 0.95098(2) \
30.0 & 36.20 & 28.73 & 0.95977(1) & 0.95382(2) & 0.95067(2) & 0.94741(2) \
\bottomrule
\end{tabular}
\end{document}
How can I get the first two rows of my table to look like the one below?




S,T, andUdefined? From the looks of it, I'd guess you don't want to use\multicolumnin the first column. And if I guess thatSis defined by thesiunitxpackage, you'll need{}around your text if you don't use\multicolumn. – Skillmon Jan 15 '24 at 07:33