In a table I want to combine some of the columns, but not in all rows. How can I realize this with LaTeX?
Asked
Active
Viewed 4.3k times
1 Answers
33
\multicolumn{<number>}{<formatting>}{<contents>}
Where the arguments are
- Number of columns to merge
- the justification and formating string (just like you use in the table header, i.e. "
|c|
" or the like) - The contents to put in the merged columns
This command simply replaces the <number>
columns and is used inline.
Addition: This is also how you change the formatting of a single field in only one row of the table. Just use \multicolumn{1}{<new format>}{<contents>}
.

dmckee --- ex-moderator kitten
- 98,632
- 24
- 142
- 234
-
Thanks, it works fine. My first problem was, that I set as formatting only {c} and at this rows no lines were drawn. I had to change format-param to {|c|}, that worked as expected. – Mnementh Jan 14 '09 at 11:46
-
1You have to add \\ at the end of the line as with any other line. – Yoav Jan 14 '13 at 20:14
-
Nice solution!! – frankliuao Oct 22 '18 at 00:36