GeneralHelp to fix: Extra alignment tab has been changed to \cr

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
larsi9621
Posts: 1
Joined: Mon Oct 05, 2020 2:57 pm

Help to fix: Extra alignment tab has been changed to \cr

Post by larsi9621 »

I need help with the following table, I want it to look as in the attached picture, however, I want to get rid of the error message, and i cannot find the flaw myself. Please help! Also even spacing of content in columns would be nice! ;)
\begin{table}[H]
\centering
\caption{Design criteria for the office building}\label{Tab:Design_criteria}
\begin{adjustbox}{max width=\textwidth}
\begin{tabularx}{\textwidth}{ |c *{3}{Y} c| }
\hline

\multicolumn{2}{|l|}{} & \begin{tabular}[c]{@{}c@{}}Meeting room\end{tabular} & \begin{tabular}[c]{@{}c@{}}Toilet\end{tabular} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Stairs/Elevator\end{tabular}}\tabularnewline [2pt]
\hline

\multicolumn{2}{|l|}{Occupant} & \begin{tabular}[c]{@{}c@{}}6\end{tabular} & \begin{tabular}[c]{@{}c@{}}-\end{tabular} & \begin{tabular}[c|]{@{}c@{}}-\end{tabular}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Floor area} & \begin{tabular}[c]{@{}c@{}}24.91\end{tabular} & \begin{tabular}[c]{@{}c@{}}24.91\end{tabular} & \begin{tabular}[c|]{@{}c@{}}24.91\end{tabular}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Occupant hours} & \begin{tabular}[c]{@{}c@{}}8 - 12\tabularnewline 13 - 17\end{tabular} & \begin{tabular}[c]{@{}c@{}}\multicolumn{2}{c}{{-}}\end{tabular} & \begin{tabular}[c]{@{}c@{}}\multicolumn{2}{c}{{-}}\end{tabular}\tabularnewline[4pt]
\hline

\multicolumn{2}{|l|}{Ventilation class} & \multicolumn{3}{c|}{II}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Emission level} & \multicolumn{3}{c|}{Low pollutants}\tabularnewline[2pt]
\hline

\begin{tabular}[c]{@{}c@{}}\multicolumn{2}{l}{Heating}\end{tabular} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Summer\tabularnewline Winter\end{tabular}} & \multicolumn{3}{c|}{\begin{tabular}[c]{@{}c@{}}24$^\circ$C \tabularnewline 20$^\circ$C\end{tabular}}\tabularnewline[4pt]
\hline

\begin{tabular}[c]{@{}c@{}}\multicolumn{2}{l}{Cooling}\end{tabular} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Summer\tabularnewline Winter\end{tabular}} & \multicolumn{3}{c|}{\begin{tabular}[c]{@{}c@{}}26$^\circ$C \tabularnewline 23$^\circ$C\end{tabular}}\tabularnewline[4pt]
\hline

\multicolumn{2}{|l|}{Ventilation rate} & \begin{tabular}[c]{@{}c@{}}41.7 - 50.7 l/s\end{tabular} & \begin{tabular}[c]{@{}c@{}}8.7 l/s\end{tabular} & \begin{tabular}[c|]{@{}c@{}}8.7 l/s\end{tabular}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Daylight} & \multicolumn{3}{l|}{\begin{tabular}[c]{@{}c@{}}$<$ 500 lx\end{tabular}}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Noise} & \multicolumn{3}{l|}{\begin{tabular}[c]{@{}c@{}}$\leq$ 35 dB\end{tabular}}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{CO$_2$} & \multicolumn{3}{l|}{\begin{tabular}[c]{@{}c@{}}$\leq$ 800 ppm above external\end{tabular}}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Energy} & \multicolumn{3}{l|}{\begin{tabular}[c]{@{}c@{}}$\leq$ 41 kWh/m$^2$ (+1000 kWh/floor area) per year\end{tabular}}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Overheating ($\sim$6$\%$ of office hour/year)} & \begin{tabular}[c]{@{}c@{}}124.8 h\end{tabular} & \begin{tabular}[c]{@{}c@{}}-\end{tabular} & \begin{tabular}[c|]{@{}c@{}}-\end{tabular}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Domestic hot water} & \multicolumn{3}{l|}{\begin{tabular}[c]{@{}c@{}}100 l/m$^2$ each year, at least 55$^\circ$C\end{tabular}}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{Infiltration} & \multicolumn{3}{l|}{\begin{tabular}[c]{@{}c@{}}1.5 l/(s$\cdot$m$^2$)\end{tabular}}\tabularnewline[2pt]
\hline

\multicolumn{2}{|l|}{PPD / PMV} & \multicolumn{3}{l|}{\begin{tabular}[c]{@{}c@{}}PPD $<$ 10$\%$ $\qquad$ and $\qquad$ -0.5$\%$ $<$ PMV $<$ 0.5$\%$\end{tabular}}\tabularnewline[2pt]
\hline

\end{tabularx}
\end{adjustbox}
\end{table}
Attachments
Table.PNG
Table.PNG (64.82 KiB) Viewed 6400 times

Recommended reading 2024:

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

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

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Help to fix: Extra alignment tab has been changed to \cr

Post by Bartman »

Please provide a complete Infominimal working example and use the highlighting of the source code.

Code: Select all

\multicolumn{2}{|l|}{Occupant hours} & 
\begin{tabular}[c]{@{}c@{}}8 - 12\tabularnewline 13 - 17\end{tabular} & 
\begin{tabular}[c]{@{}c@{}}\multicolumn{2}{c}{{-}}\end{tabular} & 
\begin{tabular}[c]{@{}c@{}}\multicolumn{2}{c}{{-}}\end{tabular}\tabularnewline[4pt]
In this part of your example, the \multicolumn commands in the tabular environments are set up to cover two columns, while only one column has been defined for the latter.

The problem also exists in other rows of the table.

You can improve the overview of your source code, if you define a new command for table templates that are used several times.
Post Reply