I'd like to make a boolean table with some inputs x, y, z and some outputs a, b, and label the first three columns In and the last two Out. The ShareLatex table documentation shows me how to merge all columns across a table, is there a way I can merge the first n in a row, and then the remainder in the same row?
Asked
Active
Viewed 1,071 times
2
MyStackRunnethOver
- 141
- 4
1 Answers
2
Let's take the above example and say we have a table 5 cells across, and we want to have a row with a 3-width multicol followed by a 2-width multicol; the row in code would look as follows:
\multicolumn{3}{|c|}{In} & \multicolumn{2}{|c|}{Out} \\
Note that we include the &, just like separating two normal-width row elements, and you may have to play around with the formatting (in this case we just keep the standard centered, single-line |c|) - to get a double line, for example, {|c||} in the first and {|c|} in the second works, but {|c|} and {||c|} won't quite match the alignment of the rest of the table.
MyStackRunnethOver
- 141
- 4
-
1Welcome! This really seems pretty standard stuff: any particular reason you thought this filled a gap in the site's coverage? While answering your own questions is perfectly fine, asking a question only in order to answer is a bit dubious, except in special circumstances. Also, please note that both questions and answers should generally include complete Minimal Working Examples (MWEs) as these are much more useful than mere fragments of code. [And vertical rules in tabulars are considered something of a typographical travesty: double ones doubly so. Though aesthetics is really off-topic.] – cfr Feb 23 '18 at 04:38
-
@cfr Thanks for the tips - I saw the duplicate note, and I think it's right - the other question does cover this material. The reason I posted this was because when I searched SO (needing to solve my own problem), I couldn't find anything because even that exact question doesn't give a hint of covering the multiple multi-cols in the same row case unless you click through to it. Should I delete the question? – MyStackRunnethOver Feb 25 '18 at 04:59
-
No real harm in leaving it as a pointer to that one. At least, I don't see any reason you should delete it now you've gone to the trouble of writing it: it may help somebody else searching for the problem. :-) – cfr Feb 25 '18 at 18:38