I've created a multi-column table with headers above each column (abridged table presented in code below). I am trying to align on the decimal point, which I've succeeded in doing using the siunitx package.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{siunitx} %%aligns by decimal points: https://tex.stackexchange.com/questions/2746/aligning-numbers-by-decimal-points-in-table-columns
\usepackage[singlelinecheck=false]{caption}
\usepackage{array}
\usepackage[document]{ragged2e}
\sisetup{
input-symbols = {()},
group-digits = false,
explicit-sign
}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\setlength{\tabcolsep}{8pt}
\hspace*{-2.5cm}
\begin{tabular}{@{}l
*{6}{S[table-format=-3.1]}@{}}
\toprule
& \multicolumn{3}{c}{ROC} &
\multicolumn{3}{c}{Quebec} \\
\cmidrule(lr){2-4}\cmidrule(lr){5-7}
Variables & Married & Cohabiting & Total &
Married & Cohabiting & Total \\ \midrule
Age difference^{ab} & & & &
& & \\
\quad 0-1 years & 36.4 & 26.3 & 35.3 &
40.7 & 28.1 & 34.9 \\
\quad Woman older (2+ years) & 11.3 & 17.0 & 11.9
& 10.3 & 11.9 & 11.0 \\
\quad Man older (2-4 years) & 27.6 & 28.8 & 27.8
& 24.0 & 37.8 & 30.3 \\
\quad Man older (5+ years) & 24.7 & 27.9 & 25.1
& 25.1 & 22.2 & 23.8 \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
However, the table's headers get wonky when my code is like this, as pictured below.
When I try to fix that, I end up undoing how the decimal points are lined up. I've tried to fix it by 1) adding back "cccccc" into the line after \begin{tabular} or using "table-number-alignment=center" on the line where I specify the number of digits for alignment of the decimal points.
I've read quite a few questions on this subject already, but none of the solutions seem to be working. I'm admittedly quite new to LaTeX, so I apologize if there is an easy answer!
Any help is greatly appreciated! Thank you.