Making a table in Latex with both single and multicolumn table headers

Table from word

I am very new to using Latex and only know the basics when it comes to creating tables. I need to create a table that has 5 columns and header made from 2 rows. The first column in the header should be the same size as the rest of the first column. The second and third rows of the header should share the 1st column header title, with two categories making up the second row of the header that lines up with the rest of the second and third columns. I would then repeat the process above for the fourth and fifth columns. I have provided a picture of what my table looks like in word for reference. Is this possible to do in LaTeX? In the attached picture, I have drawn red lines outlining where the different parts of the header and columns should be. Thanks in advance

asked Aug 30, 2017 at 17:07 WnGatRC456 WnGatRC456 180 1 1 silver badge 9 9 bronze badges Welcome to TeX.SE. Have you looked into the \multicolumn macro? Commented Aug 30, 2017 at 17:09

I have a little, but a lot of it is too advanced for me. Do you think this will work in this case where I have multicolumns and single columns?

Commented Aug 30, 2017 at 17:10 That's the intention of \multicolumn . Commented Aug 30, 2017 at 17:11

4 Answers 4

Note: Using multicolumn you just skip the merged cells, while for multirow you still type the merged cells but leave them empty.

\documentclass \usepackage \begin \begin \hline \multirow & \multicolumn & \multicolumn \\ & 1\textsuperscript Revolution & 3\textsuperscript Revolution & 1\textsuperscript Revolution & 3\textsuperscript Revolution \\ \hline 3 & 2.44\% & 6.74\% & 3.05\% & 10.4\% \\ 5 & 1.52\% & 6.65\% & 3.88\% & 11.0\% \\ 7 & 1.18\% & 2.34\% & 5.80\% & 7.11\% \\ \hline \end \end

enter image description here

This is not yet the most beautiful way of how to typeset this particular table, so keep on asking questions and looking for inspirations on this side! Consider for example using the booktabs package.

answered Aug 30, 2017 at 17:20 7,819 1 1 gold badge 18 18 silver badges 43 43 bronze badges thank you for this. I will look into booktabs for my future writing. Commented Aug 30, 2017 at 17:21

Instead of $1^>$ Revolution , I'd write 1\textsuperscript Revolution . Better not to mix TeX's text and math idioms unnecessarily. Commented Aug 30, 2017 at 17:21

@Mico: Good point, updated the question. I usually don't use superscripts in text mode, so the macro didn't catch my mind when writing up the answer.

Commented Aug 30, 2017 at 17:26

The following code should get you going.

enter image description here

\documentclass \usepackage % for \toprule, \midrule, and \bottomrule \begin \begin < l cccc >\toprule & \multicolumn & \multicolumn \\ \emph & 1\textsuperscript Revolution & 3\textsuperscript Revolution & 1\textsuperscript Revolution & 3\textsuperscript Revolution \\ \midrule 3 & 2.44\% & 6.74\% & 3.05\% & 10.4\% \\ \multicolumn & \ldots \\ % just to demonstrate power/flexibility of \multicolumn \multicolumn & \ldots \\ \bottomrule \end \end

\multicolumn takes three arguments: (1) the number of columns to be spanned, (2) the column type to be applied, and (3) what's to be typeset. The most common use of \multicolumn is, almost certainly, the placement of material that has to span two or more columns in a table header. However, \multicolumn can also be used to override the default column type for a single cell, as in done with \multicolumn and \multicolumn in the code above.