Graphics, Figures & TablesIn trouble with table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
BAC
Posts: 3
Joined: Tue Jul 30, 2019 5:17 pm

In trouble with table

Post by BAC »

This code generate the following error:
! Extra alignment tab has been changed to \cr.

for all the 4 line of the table. Why? I cannot understand.

\begin{tabular}{lcr}
\toprule
{ } & {PASCAL VOC 2012} & {PASCAL Contex} & {CamVid} & {Cityscape} \\
{DeepLabv3+} & {89,0} & {-} & {-} & { 82,1} \\
{MSCI} & {88,0} & {50,3} & {-} & {-} \\
{SDN} & {86,6} & {-} & {71,8} & {-} \\
\bottomrule
\end{tabular}

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

In trouble with table

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

You have more columns (5) than column formatting specifiers (3, lcr). This would work:

Code: Select all

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{lcccc}
\toprule
{ } & {PASCAL VOC 2012} & {PASCAL Contex} & {CamVid} & {Cityscape} \\
{DeepLabv3+} & {89,0} & {-} & {-} & { 82,1} \\
{MSCI} & {88,0} & {50,3} & {-} & {-} \\
{SDN} & {86,6} & {-} & {71,8} & {-} \\
\bottomrule
\end{tabular}
\end{document}
Stefan
LaTeX.org admin
BAC
Posts: 3
Joined: Tue Jul 30, 2019 5:17 pm

In trouble with table

Post by BAC »

Oh it was simple! Thank you!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

In trouble with table

Post by Stefan Kottwitz »

Yes, easy to help out :) no problem if you ask questions here and save time searching a lot yourself.

Stefan
LaTeX.org admin
Post Reply