![自定义表格列](https://linux22.com/image/430706/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A1%A8%E6%A0%BC%E5%88%97.png)
答案1
\sffamily
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{2}{|c|}{\textbf{INPUT}} & \textbf{OUTPUT} \\ \hline
A & B & A NAND B \\ \hline
0 & 0 & 1 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 0 \\ \hline
\end{tabular}
\quad %
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{2}{|c|}{\textbf{INPUT}} & \textbf{OUTPUT} \\ \hline
A & B & A AND B \\ \hline
0 & 0 & 0 \\ \hline
0 & 1 & 0 \\ \hline
1 & 0 & 0 \\ \hline
1 & 1 & 1 \\ \hline
\end{tabular}
答案2
我认为这是你要找的桌子(没有任何旋转)
\documentclass[12pt,a4paper]{article}
\usepackage{array}
\begin{document}
\sffamily
\renewcommand{\arraystretch}{2} % adjust to expand the cells vertically
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{\bfseries INPUT} & \multicolumn{2}{c|}{\bfseries OUTPUT} \\ \hline
A & B & A NAND B & A AND B \\ \hline
0 & 0 & 1 & 0 \\ \hline
0 & 1 & 1 & 0 \\ \hline
1 & 0 & 1 & 0 \\ \hline
1 & 1 & 0 & 1 \\ \hline
\end{tabular}
\end{document}
答案3
如果您不想旋转,只需用于\multicolumn
拆分列即可。
\documentclass{article}
\begin{document}
\begin{table}[]
\centering
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{2}{|c|}{INPUT} & OUTPUT \\ \hline
A & B & A AND B \\ \hline
0 & 0 & 1 \\ \hline
0 & 1 & 1 \\ \hline
1 & 0 & 1 \\ \hline
1 & 1 & 0 \\ \hline
\end{tabular}
\end{table}
\end{document}