1
\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{array}
\makeatletter
\g@addto@macro{\endtabular}{\rowfont{}}% Clear row font
\makeatother
\newcommand{\rowfonttype}{}% Current row font
\newcommand{\rowfont}[1]{% Set current row font
\gdef\rowfonttype{#1}#1%
}
\newcolumntype{L}{>{\rowfonttype}l}
\newcolumntype{C}{>{\rowfonttype}c}
\begin{document}
\begin{table}[h]
\begin{threeparttable}
    \footnotesize\caption{\footnotesize AAR,CAAR}
            \captionsetup{justification=justified, singlelinecheck=true}
    \begin{tabular}{C@{\hspace{1cm}}*{6}{p{.125\textwidth}}}
        \toprule
        & \multicolumn{2}{c}{Phase 1} &  \multicolumn{2}{c}{Phase 2} & \multicolumn{2}{c}{Phase 3} \\
        \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}
        Day & AAR & CAAR &  AAR & CAAR & AAR & CAAR\\ 
        \midrule
        $-10$   & 0.00029 & 0.00029 & $-0.00077$ &  $-0.00077$& $-0.00116$ & $-0.00116$ \\
                & (0.09) &  (0.09) & $(-0.36)$ & $(-0.36)$&$(-0.42)$ &$ (-0.42)$
\bottomrule
    \end{tabular}
    \begin{tablenotes}[para]
        \item[*] $p<0.05$
        \item[**] $p<0.01$
        \item[***] $p<0.001$
    \end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

Table1

Hello,again!I am trying to center 6 right columns and have no clue where to put "C" in this expression :

\begin{tabular}{C@{\hspace{1cm}}*{6}{p{.125\textwidth}}}

I would appreciate any help!

1

Add >{\centering\arraybackslash} in font of the 6 last specifiers. However, the table is a little too wide for the text width, so I used a tabularx environment, which computes the width of the X columns, given the total width of the table.

\documentclass[12pt]{article}
\usepackage[a4paper,  showframe]{geometry}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{caption}
\usepackage{array,  tabularx}
\makeatletter
\g@addto@macro{\endtabular}{\rowfont{}}% Clear row font
\makeatother
\newcommand{\rowfonttype}{}% Current row font
\newcommand{\rowfont}[1]{% Set current row font
\gdef\rowfonttype{#1}#1%
}
\newcolumntype{L}{>{\rowfonttype}l}
\newcolumntype{C}{>{\rowfonttype}c}

\begin{document}

\begin{table}[!h]
\begin{threeparttable}
    \footnotesize\caption{\footnotesize AAR,CAAR}
            \captionsetup{justification=justified, singlelinecheck=true}
    \begin{tabularx}{\linewidth}{C@{\hspace{1cm}}*{6}{ >{\centering\arraybackslash}X}}
        \toprule
        & \multicolumn{2}{c}{Phase 1} & \multicolumn{2}{c}{Phase 2} & \multicolumn{2}{c}{Phase 3} \\
 \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}
 Day & AAR & CAAR & AAR & CAAR & AAR & CAAR\\ \midrule $-10$ & 0.00029 & 0.00029 & $-0.00077$ & $-0.00077$& $-0.00116$ & $-0.00116$ \\
  & (0.09) & (0.09) & $(-0.36)$ & $(-0.36)$&$(-0.42)$ &$ (-0.42)$ \\
 \bottomrule
    \end{tabularx}
    \begin{tablenotes}[para]
\smallskip
        \item[*] $p<0.05$
        \item[**] $p<0.01$
        \item[***] $p<0.001$
    \end{tablenotes}
\end{threeparttable}
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.