How do I make a State Table in Tabular?

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.

• Please also keep in mind that horizontal lines from the booktabs package are intended to be used without vertical lines, so you might also want to replace {@{}c c c | c c c@{}} with {@{}c c c c c c@{}} or {@{} *{6}{c} @{}}. Apr 22, 2021 at 21:54
• Replace \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}. Apr 22, 2021 at 21:58

\documentclass[a4paper,11pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{booktabs}
\usepackage{array}

\begin{document}

\begin{tabular}{*{6}{wc{7mm}}} \toprule
\multicolumn{3}{c}{Present State} &
\multicolumn{3}{c}{Next State} \\ \cmidrule(lr){1-3}\cmidrule(lr){4-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}

\end{document}


• now that is beautiful Apr 22, 2021 at 22:02