I am trying to create a table using the code provided here for decimal alignment and the code provided here to have two lines for some headers. Since I'm not sure exactly what each line does, I had trouble applying it to my table. As shown below, the first and second column formats the year intervals differently and the second column is not centered.
Further, could someone explain what \begin{tabular}{l*{4}{d{3.3}} }
does?
Any help with fixing these issues, and any other possible improvements you see, would be greatly appreciated.
\documentclass{article}
\usepackage{dcolumn,booktabs}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\newcommand*{\thead}[1]{%
\multicolumn{1}{c}{\bfseries\begin{tabular}{@{}c@{}}#1\end{tabular}}}
\begin{document}
\begin{table}
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{l*{4}{d{3.3}} }
\toprule
\thead{First Year\\Interval}& \thead{Second Year\\Interval} & \thead{Mean Difference} & \thead{95\% Family-Wise\\ Confidence Interval} \\
\midrule
2001-05& 1980-85 &0.08& (-0.46,0.62)\\
2016-20 &1980-85 &-0.21& (-0.76,0.33)\\
2011-15& 2006-10& 0.04 &(-0.06,0.14)\\
\bottomrule
\end{tabular}
\end{table}
\end{document}