GeneralFix table error: Extra alignment tab has been changed to \cr

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Aurora
Posts: 17
Joined: Thu Jun 28, 2007 3:42 pm

Fix table error: Extra alignment tab has been changed to \cr

Post by Aurora »

hi there,

I have some problems with a table in LaTeX.

I have this code:

Code: Select all

\begin{table}[hb]
	\centering
		\begin{tabular}{|c|c|}
			\hline
		  \textbf{Formelzeichen}	&	\textbf{Beschreibung}	& \hline\hline
			$Q$ 										& Menge der Zustände		&	\hline 
			$\Sigma$								& Eingabealphabet				& \hline 
			$T$											& Arbeitsalphabet				& \hline 
			$\delta$								& Überführungsfunktion	& \hline 
			$q_0$										& Anfangszustand				& \hline 
			$F$											& Menge der Endzustände	& 
			\hline 
		\end{tabular}
	\caption{Bestandteile einer Turingmaschine}
\end{table}
But I get errors like:
! Extra alignment tab has been changed to \cr.
<recently read> \endtemplate

l.48 ...f{Formelzeichen} & \textbf{Beschreibung} &
\hline\hline
You have given more \span or & marks than there were
in the preamble to the \halign or \valign now in progress.
So I'll assume that you meant to type \cr instead.


I hope you can help me solve this problem.
Thanks a lot.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Fix table error: Extra alignment tab has been changed to \cr

Post by localghost »

You declare a tabular with two columns. So you have to omit the last alignment and replace it with the command for a new tabular line.

Code: Select all

\begin{table}[!ht]
  \centering
  \begin{tabular}{|c|c|} \hline
    \textbf{Formelzeichen} & \textbf{Beschreibung} \\ \hline\hline
    $Q$ & Menge der Zustände \\ \hline
    $\Sigma$ & Eingabealphabet \\ \hline
    $T$ & Arbeitsalphabet \\ \hline
    $\delta$ & Überführungsfunktion \\ \hline
    $q_0$ & Anfangszustand \\ \hline
    $F$ & Menge der Endzustände \\ \hline
  \end{tabular}
  \caption{Bestandteile einer Turingmaschine}
\end{table}
Aurora
Posts: 17
Joined: Thu Jun 28, 2007 3:42 pm

Re: problems with table

Post by Aurora »

Thanks a lot. Works great now.
Post Reply