I want a table that looks similar to this one where Present State
and Next State
aren't aligned so close to each other and have their own respective columns.
The code I have right now:
\begin{tabular}{@{}c c c | c c c@{}} \toprule
\multicolumn{6}{c}{Present State Next State} \\ \cmidrule(r){1-6}
A & B & C & A & B & C\\ \midrule
0 & 0 & 0 & 0 & 1 & 0\\
0 & 0 & 1 & 0 & 1 & 0\\
0 & 1 & 0 & 0 & 1 & 0\\
0 & 1 & 1 & 0 & 1 & 0\\
1 & 0 & 0 & 0 & 1 & 0\\
1 & 0 & 1 & 0 & 1 & 0\\
1 & 1 & 0 & 0 & 1 & 0\\
1 & 1 & 1 & 0 & 1 & 0\\
\bottomrule
\end{tabular}
What I get from doing the above:
I've looked into the tabular
documentation, and there's no explanation for having two columns that have three child columns. Oh, I forgot to mention; I'm using the booktabs
package.
{@{}c c c | c c c@{}}
with{@{}c c c c c c@{}}
or{@{} *{6}{c} @{}}
.\multicolumn{6}{c}{Present State Next State}
with\multicolumn{3}{@{}c}{Present State} & \multicolumn{3}{c@{}}{Next State}
and\cmidrule(r){1-6}
with\cmidrule(r){1-3} \cmidrule(l){4-6}
.