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.
Best Answer
You can use
\multicolumn{2}{c}{Text}
to have a cell with contentText
, aligned asc
(you could also add vertical lines here), spanning2
columns. This can be used for single columns, or some or all columns in a row.\multirow{2}{*}{Text}
to have a cell with contentText
spanning2
rows.Note: Using
multicolumn
you just skip the merged cells, while formultirow
you still type the merged cells but leave them empty.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.