3

I want to place three arrays side by side. They all should be aligned by their top line. How can I do that with the following arrays:

\[
\begin{array}{c c | c}
p   &   q   &   p   \land   q   \\ \hline
1   &   1   &   1 \\
1   &   0   &   0 \\
0   &   1   &   0 \\
0   &   0   &   0 \\
\end{array}
\]

\[
\begin{array}{c c | c}
p   &   q   &   p   \lor    q   \\ \hline
1   &   1   &   1 \\
1   &   0   &   1 \\
0   &   1   &   1 \\
0   &   0   &   0 \\
\end{array}
\]

\[
\begin{array}{c | c}
p   &   \lnot p \\ \hline
1   &   0 \\
0   &   1 \\
\end{array}
\]
1
  • 2
    Welcome to TeX. SE! Write them in one equation, without empty lines between them. See answer below.
    – Zarko
    Nov 6, 2020 at 12:49

1 Answer 1

5
\documentclass{article}

\begin{document}
\[
\begin{array}[t]{c c | c}
p   &   q   &   p   \land   q   \\ \hline
1   &   1   &   1 \\
1   &   0   &   0 \\
0   &   1   &   0 \\
0   &   0   &   0 \\
\end{array}
\qquad
\begin{array}[t]{c c | c}
p   &   q   &   p   \lor    q   \\ \hline
1   &   1   &   1 \\
1   &   0   &   1 \\
0   &   1   &   1 \\
0   &   0   &   0 \\
\end{array}
\qquad
\begin{array}[t]{c | c}
p   &   \lnot p \\ \hline
1   &   0 \\
0   &   1 \\
\end{array}
\]

enter image description here

or if you remove arrays' positioning options [t] in above MWE, you will get:

enter image description here

2
  • Thank you very much @Zarko.
    – NilsK
    Nov 6, 2020 at 12:56
  • 1
    @NilsK, you are welcome!
    – Zarko
    Nov 6, 2020 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .