0

enter image description here

Please see below for the description!

1
  • What did you try so far? The column headers can be achieved using a combination of multicolumn and multirow. Thead from the makecell package and the horizontal lines from the booktabs package might also come in handy.
    – leandriis
    Commented Jan 24, 2020 at 17:32

1 Answer 1

2

You'd need a very large text width for that.

Here's a proof of concept.

\documentclass{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage{siunitx,booktabs}
\usepackage{newtxtext,newtxmath}

\newcommand{\header}[1]{%
  \begin{tabular}[t]{@{}c@{}}#1\end{tabular}%
}
\newcommand{\theader}[1]{\smash{\header{#1}}}

\begin{document}

\begin{table}
\setlength{\tabcolsep}{0pt}
\small

\caption{Sources of Growth Rate Differences (\%)\label{SGRD}}

\medskip

\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  l
  S[table-format=-1.1]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
}
\multicolumn{9}{l}{\textbf{Period 2 vs.\ Period 1}}\\
\midrule[\heavyrulewidth]
\multicolumn{1}{c}{\theader{Period 2 vs. \\ Period 1}} &
{\theader{Difference \\ in Growth \\ Rate}} &
\multicolumn{3}{c}{\header{Due to Change in Elasticity \\ of Output with respect to}} &
\multicolumn{3}{c}{\header{Due to Change in \\ Growth Rate of}} &
{\theader{$dy/dx$ \\ oil}} &
{\theader{Local \\ Technical \\ Progress}} \\
\cmidrule{3-5} \cmidrule{6-8}
& & {\header{Tangible \\ Capital}} & {Labor} & {\header{Human \\ Capital}} &
    {\header{Tangible \\ Capital}} & {Labor} & {\header{Human \\ Capital}} \\
\midrule
Canada     & -1.4 & -0.22 & 0.18 & -0.08 & -0.36 & -0.21 & -0.14 & -0.31 & -0.24 \\
France     & -3.1 & \\
W. Germany & -2.9 \\
\bottomrule
\end{tabular*}

\end{table}

\end{document}

enter image description here

With \header the cell can be split across rows, I use \theader for the same purpose, but the cells so built do not occupy vertical space due to \smash.

5
  • Is it possible to have the "smashed" headers aligned at the bottom baseline? If I change the alignment in the definition of \header to [b], the smashed header is still aligned at the top.
    – Sveinung
    Commented Jan 24, 2020 at 19:03
  • @Sveinung Why would you? They belong to the upper level. The alternative would be to vertically center them (which I dislike so much).
    – egreg
    Commented Jan 24, 2020 at 20:31
  • @Sveinung To be honest, I'd remove the leftmost header, because it's already at the top and abbreviate all other headers, adding a legend at the bottom.
    – egreg
    Commented Jan 24, 2020 at 22:05
  • Thank you! Is there a way to make this table sideways, and perhaps take the whole length of a horizontal page?
    – tiffj56
    Commented Jan 31, 2020 at 16:56
  • @tiffj56 Consult the manual of rotating
    – egreg
    Commented Jan 31, 2020 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .