Monday, 26 August 2013

How do you display table headers that are wider than the rest of the column?

How do you display table headers that are wider than the rest of the column?

I have a table with lots of columns, which only contain a short values,
but have long headings. I think this table would fit width-wise on a
single (landscape) page, if I could get the headings sit on alternating
rows, with the ends overlapping.
How can I achieve this?
(I've tried writing two header rows, with half the column names in one row
and half in another, using \multicolumn, but I can't get them to then
align neatly with the columns.)
\documentclass[]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{ccc}
\toprule
Lengthy words which & make my columns too wide like &
antidisestablishmentarianism\\
\midrule
1 & 0 & 0\\
3 & 7 & 5\\
\bottomrule
\end{tabular}
\end{document}
Or, alternatively, is Big table with rotated column labels using booktabs
the preferred layout for tables with long headings? I am reluctant to use
it, because there are enough rows that the headers will need to be
repeated on multiple pages already; making them taller will exacerbate
this problem.

No comments:

Post a Comment