[Tex/LaTex] Hierarchical Table Help

examplestables

I am trying to recreate the "Not Enough" table from the Example Tables 1 on slide 12/16 from here. This is my current code, its close but not right. How do I get the column headers to stack word over word, and how do I get the column headers to align with the rest of the column?

\begin{table}[H]
\centering
\begin{tabular}{llcc} 
{} &  {} & readers in 2006 & top editorial positions \\
\hline
\multicolumn{3}{l}{Dailies} \\
{} & Suddeustsche Zeitung & 44.0 & 10.0 \\
{} & Frankfurter & 36.0 & 6.25 \\
{} & Handelsblatt & 25.0 & 0 \\
\hdashline
\end{tabular}
\caption[Not Enough]{Not Enough}
\label{tab:tnotEnough}
\end{table}

NOTE: I am using \usepackage{arydshln} for \hdashline

Best Answer

Use the array package to define a new fixed width column type with centered contents. Also, you might want to define a column type that aligns at the decimal point. Use the dcolumn package for that.

\documentclass{article}
\usepackage{array,booktabs,dcolumn,calc}
\newcolumntype{C}{>{\centering\arraybackslash}b{\widthof{positions}}}
\newcolumntype{d}{D{.}{.}{-2}}
\begin{document}

\begin{tabular}{@{\quad}l*{2}{d}@{}} 
& \multicolumn{1}{C}{readers in 2006} 
& \multicolumn{1}{C@{}}{top editorial positions} \\
\midrule
\multicolumn{3}{@{}l}{Dailies}     \\
Suddeustsche Zeitung & 44.0 & 10.0 \\
Frankfurter          & 36.0 & 6.25 \\
Handelsblatt         & 25.0 & 0    \\
\bottomrule
\end{tabular}

\end{document}
Related Question