0

First of all let me start out by saying that I'm very new to anything regarding tables in Latex. That being said, here is my problem:

\begin{tabular}{| c | c | c | c |}
  a & b & c & d & \hline
\end{tabular}

So why does the error extra alignement tab has been .... occur? And how do I solve it?

Thanks in advance

2

In your tabular definition, you define four columns. Columns are separated by &:

\begin{tabular}{cccc}
column 1 & column 2 & column 3 & column 4
\end{tabular}

Thus, only between columns you need to put & - and nowhere else (in particular, do not end the last column with &).

Rows are separated by the newline \\:

\begin{tabular}{cccc}
column 1 & column 2 & column 3 & column 4 \\
column 1 & column 2 & column 3 & column 4 \\
\end{tabular}

(You may end the last row with \\, but that's optional and the final "empty" row is ignored)

Note that \hline needs to start at a new row, thus:

\begin{tabular}{cccc}
column 1 & column 2 & column 3 & column 4 \\
\hline % no \\ here, \hline is a complete row on its own
column 1 & column 2 & column 3 & column 4 \\
\end{tabular}

Therefore, as David points out, change your last & to \\

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.