I have a regression table that has three columns. One for the names, one for the estimates and one for the standard errors. The two columns that display the estimates and the standard errors are headed by the name of a variable. I align the numbers in the cells with the help of \dcolumn.
The problem is, that if there is a rather long text in a \multicolumn, it is the last column of the table that gets stretched. This problem is known and there are already solutions for that here and here.
I just don't get how I could apply them to my table with aligned columns.
Here is a MWE with vertical bars to better illustrate the widths:
\documentclass{article}
\usepackage{tabularx}
\usepackage{dcolumn}
\usepackage{booktabs}
\begin{document}
\begin{table}[t]
\caption{MWE}
\centering
\begin{tabular}{l|D{.}{.}{3}|D{.}{.}{3}}
\toprule
& \multicolumn{2}{c}{Long name of dependent variable} \\
& \multicolumn{1}{c}{$\beta$} & \multicolumn{1}{c}{\textit{SE}} \\
\midrule
x1 & 0.020 & (0.009) \\
x2 & -0.345 & (0.123) \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
What I would like to see is this alignment, equal column widths and a centered column header:
...but with the variable name as in the first table.
Note: I do not insist on using \dcolumn or any other package. Everything that works (and does not potentially create issues with other basic packages) is fine.




@{}in the start and end of the tabular preamble to remove the side bearing. – Sveinung Jul 11 '19 at 13:55