I have a table with a complex heading using multirow
and multicol
packages. I'd like to have the second column of the following table as S
type from siunitx
package for to align the numbers by its decimal separator, however I failed. Any help, please?
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{multirow,multicol}
\begin{document}
\begin{table}[htb]
\footnotesize
\centering
\caption{Example Table}
\begin{tabular}{ccSS}% <--- HERE
\midrule
\multirow{2}{*}{\textbf{Column 1}} &
\multirow{2}{*}{\textbf{%
\begin{tabular}[c]
{@{}c@{}}Column 2\\
(\si{\g/\mL})
\end{tabular}}} &
\multicolumn{2}{c}{\textbf{Column 3 (\si{\ug/\L})}} \\
\cmidrule{3-4}& &
\textbf{Column 3.1} & \textbf{Column 3.2}\\
\midrule
AE1 & 3.45 & \multicolumn{ 2}{c}{Some text} \\
AE2 & 20.65 & 50 & 4.5 \\
AE3 & 12.67 & 20 & 7.5 \\
AE4 & 0.78 & 75 & 12.09 \\
AE5 & 3.098 & 100 & 14 \\
\midrule
\end{tabular}
\end{table}
\end{document}
Best Answer