today is my first day to learn how to make a table in Latex. I come up with the following example:
My difficult right now is how to align asterisks. I want to match 0.019's "9" with the ending bracket of the number (36.58), then the asterisk should follow the "9" and should not be above the ")" of 36.58, can anyone help me with that?
\documentclass[11pt,a4paper]{article}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{makecell,graphicx,rotating,array,dcolumn,lscape}
\begin{document}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\def\sym#1{\ensuremath{^{\mathrlap{#1}}}}
\begin{landscape}
{\setlength{\extrarowheight}{1.5pt}
\begin{table}[htbp]
\sisetup{table-align-text-post=false}
\centering
\caption{The Results of Future Abnormal Return}
\begin{tabular}{*{9}{l}}
\toprule
\multicolumn{1}{l}{}& \multicolumn{1}{c}{EW1M}& \multicolumn{1}{c}{EW3M}&\multicolumn{1}{c}{EW6M}&\multicolumn{1}{c}{EW12M}&\multicolumn{1}{c}{VW1M} &\multicolumn{1}{c}{VW3M}&\multicolumn{1}{c}{VW6M}&\multicolumn{1}{c}{VW12M}\\
\multicolumn{1}{c}{} & \multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)}& \multicolumn{1}{c}{(7)}& \multicolumn{1}{c}{(8)}\\ \midrule
Purchaser (NPV) &0.019^{***}&0.021^{***}&0.025^{***}&0.025^{***}&0.017^{***}&0.025^{***}&0.038^{***}&0.060^{***}\\
&(36.58)&(26.98)&(23.34)&(16.84)&(34.03)&(31.64)&(34.72)&(38.85)\\
&130,982 &129,738 &128,316 &124,121 &130,982 &129,738 &128,316 &124,121\\
Purchaser (NPR) &0.019^{***}&0.021^{***}&0.025^{***}&0.025^{***}&0.017^{***}&0.025^{***}&0.038^{***}&0.060^{***}\\
&(36.57)&(26.99)&(23.37)&(16.89)&(34.03)&(31.64)&(34.72)&(38.85)\\
&130,904 &129,660 &128,239 &124,051 &130,982 &129,738 &128,316 &124,121\\
\end{tabular}%
\label{tab:addlabel}%
\end{table}}
\end{landscape}
\end{document}
siunitx
package, but you're not using its extensive table formatting abilities. You've also defined ad
column type, but you're not using that either. Butsiunitx
should be able to do most of this.\begin{tabular}{l *{8}{d{3}}}
-- ?