I want to solve a problem where I want to use a table for illustration purposes. I have managed to solved the problem in a very cumbersome way but I think there has to be a "smart" way as well. My current solution is very fragile since it is dependent of sizes etc.
What I want (ASCII-style):
-----------------------------
| Concept 1 | <--- bold heading
-----------------------------
| C11 | C12 | C13 | <--- three items in this row
----------------------------- <--- in current solution, bot tab 1 and top tab 2
| C2 | | C4 | <--- bold heading
--------| C3|---------------- <--- C3 takes two lines, since no subconcepts
|C21|C22| |C41|C42|C43|C44| <--- seven items in this row
----------------------------- <--- in current solution, bot tab 2 and top tab 3
| Concept 5 | <--- bold heading
-----------------------------
| C51 | C52 | C53 |
-----------------------------
I have abbreviated for space above. C2 => Concept 2, C11 => Concept 1 part 1 etc.
The above ASCII table I how I would have like to have it. And now I've solved it by making one table
environment with three tabulars and playing around with parskips to make it look as one tabular.
Concepts 2, 3 and 4 belong together, so I don't want to change positions.
I guess it could be possible in one tabular with 21 columns (i.e. 7*3 to account for possible positions), and use multicol
for everything. But surely there must be a better way?
Packages etc don't matter, but would be nice if it compiled in a memoir document.
Current solution psuedo-code:
begin{table}
begin{tabularx}{*{3}{c}}
multicol{3}{Concept 1} \\
C11 & C12 & C13 \\
end{tabularx}
% Magic \par\vskip
begin{tabularx}{*{7}{c}}
multicol{1}{Concept 2} & multirow{*}{2}{Concept 3} & multicol{4}{Concept 4} \\
C21 & C21 & & C41 & C42 & C43 & C44 \\
end{tabularx}
% Magic \par\vskip
begin{tabularx}{*{3}{c}}
multicol{3}{Concept 5} \\
C51 & C52 & C53 \\
end{tabularx}
end{table}
\multicolumn
(e.g.\multicolumn{2}{c}{text}
) and\multirow
(e.g.\multirow{2}{*}{text}
, need themultirow
package) . For the bold headings is enough change the cell content to\textbf{Concept 1}
. After read something about these commands, edit the question to change the pseudocode with a real code in a compilable minimal working example (MWE) with you best try, if you still have some problem.