[Tex/LaTex] Design of a table from an article

tables

In an article I met this table.enter image description here

How can one design such a table?

Best Answer

Here's a solution that uses the dcolumn package to align the numbers on the decimal markers.

enter image description here

\documentclass{article} 

\usepackage{dcolumn,booktabs}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro

\begin{document} 
\begin{table}
\centering
\begin{tabular}{ l *{4}{d{4.5}} }
\toprule
& \multicolumn{2}{c}{A} & \multicolumn{2}{c}{B}\\
\cmidrule(lr){2-3} \cmidrule(l){4-5}
& \mc{Weight (lbs.)} & \mc{Weight (lbs.)} & \mc{Price} & \mc{Price} \\
\midrule 
Mileage & -108.4^{***} & -91.22^{***} & & \\
        & (-11.60) & (-10.34) & & \\
\addlinespace
Car type & & & & \\
 & & & & \\
\addlinespace
Weight (lbs.) & & & 1.747^{***} & 3.465^{***}\\
              & & & (2.72) & (5.49) \\
\addlinespace
Constant & 5328.8^{***} & & & \\
         & (25.85)      & & & \\
\midrule
Observations & \mc{74} & \mc{74} & \mc{74} & \mc{74} \\
\bottomrule
\multicolumn{5}{l}{\footnotesize $t$ statistics in parentheses}\\
\multicolumn{5}{l}{\footnotesize ${}^{*}\ p<0.05$, \dots}\\
\end{tabular}
\end{table}
\end{document}
Related Question