3

when I try to use a \begin{left} and \begin{right}, they get mixed up. this is my code

\begin{left}
    \begin{tabular}{l|c|c}
        Monophthongs & Front & Back \\
        \hline
        Close & i iː & u uː \\
        Mid & e eː & o oː \\
        Open & a aː
    \end{tabular}
\end{left}
\begin{right}
    \begin{tabular}{c|c}
         Diphthongs & a & e & i & o & u \\
         \hline
         a &  & ae &  &  & au \\
         e &  &  & ei &  & eu \\
         u &  &  & ui &  &  \\
         i &  &  &  & io & iu \\
         o &  & oe &  &  &  \\
    \end{tabular}
\end{right}
Bernard
  • 271,350
  • Welcome to TeX.SX! What exactly do you want to achieve by using \begin{left}... \end{left} and \begin{right}...\end{right} here? Do you want both tables to show up side by side? – leandriis May 20 '21 at 17:09
  • 1
    If you're interested in two side by side tables, you may want to givethe following a try: \documentclass{article} \begin{document} \begin{tabular}[t]{l|c|c} Monophthongs & Front & Back \\ \hline Close & i iː & u uː \\ Mid & e eː & o oː \\ Open & a aː \end{tabular} \quad \begin{tabular}[t]{c|ccccc} Diphthongs & a & e & i & o & u \\ \hline a & & ae & & & au \\ e & & & ei & & eu \\ u & & & ui & & \\ i & & & & io & iu \\ o & & oe & & & \\ \end{tabular} \end{document} The corresponding output looks like the following: https://i.stack.imgur.com/FlR4I.png – leandriis May 20 '21 at 17:11
  • Thanks! Im going to see if this works! – SeveronS May 20 '21 at 17:12
  • @leandriis +1. I would have done the same thing – LukeTheWolf May 20 '21 at 17:13
  • @leandriis Probably the OP is looking for \begin{tabular}[t]{c|c|c|c|c|c} on the right side – LukeTheWolf May 20 '21 at 17:15
  • I'm looking for two side to side tables, one with the monothongs and one with the dipthongs. – SeveronS May 20 '21 at 17:16

1 Answers1

6

I guess, you wanted to get both tables to show up side by side. To achieve this, remove the left and right environment and make sure, there is no empty line between the first \end{tabular} and the following \begin{tablar}. To get a small horizontal white space between both tables, I used \quad here, but you could also usa any other command for horizontal spacing of your choice here.

To make sure, both tables are top aligned with respect to each other, I added [t] to both tabular environments. Other options include [c] for vertically centered and [b] for bottom alignment.

Lastly, I also added the missing column specifiers in your second table. Using c|c you only declared 2 columns, but used a total of 6 columns in your table. I thus changes that to c|ccccc. Feel free to change the column specifiers to suit your needs.

If you want to add a caption for both tables of an individual caption for each table, take a look at https://tex.stackexchange.com/a/597566/134144 for an overview over different options and approaches on how to do that.

\documentclass{article}
\begin{document}
\begin{tabular}[t]{l|c|c}
    Monophthongs & Front & Back \\
    \hline
    Close & i iː & u uː \\
    Mid   & e eː & o oː \\
    Open  & a aː
\end{tabular}

\quad \begin{tabular}[t]{c|ccccc} Diphthongs & a & e & i & o & u \ \hline a & & ae & & & au \ e & & & ei & & eu \ u & & & ui & & \ i & & & & io & iu \ o & & oe & & & \ \end{tabular}

\end{document}

enter image description here

leandriis
  • 62,593