# Unable to create table. Missing number treated as zero error

I coded the following table:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[]{booktabs}
\title{table}
\author{subham.soni007 }
\date{March 2015}

\begin{document}
\begin{table}[h]
\begin{tabular}{@{}lll@{}}
\toprule
\multicolumn{1}{c}{\textbf{PARAMETER}}                                               & \multicolumn{1}{c}{\textbf{EXISTING SYSTEM}}                                                        & \multicolumn{1}{c}{\textbf{PROPOSED SYSTEM}}                                                          \\ \midrule
\textbf{Type}                                                                        & Content-Based                                                                                       & Service-Based                                                                                         \\
\textbf{User’s Context}                                                              & \begin{tabular}[c]{@{}l@{}}The dialogue does not change \\ according to user’s context\end{tabular} & \begin{tabular}[c]{@{}l@{}}The dialogue changes according \\ to user’s context and needs\end{tabular} \\
\textbf{\begin{tabular}[c]{@{}l@{}}Failure\\ Recovery\end{tabular}}                  & \begin{tabular}[c]{@{}l@{}}User is not notified \\ about the failure\end{tabular}                   & \begin{tabular}[c]{@{}l@{}}The session is maintained, next time\\ when the user calls\end{tabular}    \\
\textbf{\begin{tabular}[c]{@{}l@{}}Number\\ of Dialogues\end{tabular}}               & Fixed                                                                                               & Variable                                                                                              \\
\textbf{\begin{tabular}[c]{@{}l@{}}Use of Domain-Specific\\  Knowledge\end{tabular}} & \begin{tabular}[c]{@{}l@{}}Does\\ not use\end{tabular}                                              & Uses domain-specific knowledge                                                                        \\ \bottomrule
\end{tabular}
\end{table}
\end{document}


When I compile in WinEdt, I get an error that missing number treated as zero near \begin{tabular}{@{}lll@{}}. But when I compile with sharelatex, everything is fine. What is the issue?

• I get no error on TeXLive 2014... – user31729 Mar 23 '15 at 15:46
• Also with MikTeX 2.9. – percusse Mar 23 '15 at 15:46
• Also with MiKTeX and WinEdt. – Bernard Mar 23 '15 at 16:03
• You say you get the error near \begin{tabular}{@{}lll@{}}, but are you sure that your code you are working on matches the MWE? I ask because I often get "missing number" errors in tables when I'm missing a brace in a parameter. – John Laviolette Mar 24 '15 at 0:20
• No error either with TeXworks and MacTeX2014. – Mico Mar 24 '15 at 6:41

I propose this code, which is simpler:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[]{booktabs}
\usepackage{ragged2e}
\usepackage{array, tabularx}
\renewcommand{\tabularxcolumn}[1]{>{\RaggedRight\arraybackslash} m{#1}}
\newcolumntype{Y}{ >{\bfseries\RaggedRight\hsize=0.9\hsize}X}
\newcolumntype{Z}{ >{\RaggedRight\hsize=1.1\hsize}X}
\usepackage{makecell}
\title{table}
\author{subham.soni007 }
\date{March 2015}

\begin{document}

\begin{table}[h]
\setlength\tabcolsep{4pt}%
\begin{tabularx}{\linewidth}{@{\,}>{\bfseries}YXZ@{\,}}
\toprule
\midrule
Type & Content-Based & Service-Based \\
User’s Context & The dialogue does not change according to user’s context & The dialogue changes according to user’s context and needs \\
Failure Recovery & User is not notified about the failure & The session is maintained, next time when the user calls \\
Number\break of Dialogues & Fixed & Variable \\
Use of Domain-Specific Knowledge
& Does not use & Uses domain-specific knowledge \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}


Rather than use ALL-CAPS HEADERS and bold lettering to provide visual emphasis, I would focus on optimizing the table's structure in order to enhance its readability and intelligibility. To that effect, it's usually a good idea to avoid repetitive material and to move important information into the header row and left-most column of the table.

Here's a before-and-after comparison of the way your table can look.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs,ragged2e,tabularx}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\usepackage{xcolor}  % just for this example
\begin{document}

\noindent
\textcolor{red}{\texttt{after}}
\begin{table}[h]
\begin{tabularx}{\textwidth}{@{} LLL @{}}
\toprule
Parameter & Existing System & Proposed System \\
\midrule
Type & Content-based & Service-based \\ \addlinespace
Dialogue changes with user's context and needs & No & Yes \\ \addlinespace
Failure recovery & User is not notified about the failure
& Session is maintained, next time when the user calls \\ \addlinespace
Number of dialogues & Fixed & Variable \\ \addlinespace
Use of domain-specific knowledge & No & Yes \\
\bottomrule
\end{tabularx}
\end{table}

\bigskip\noindent
\textcolor{red}{\texttt{before}} (width of text block is exceeded massively)
\begin{table}[h]
\begin{tabular}{@{}lll@{}}
\toprule
\multicolumn{1}{c}{\textbf{PARAMETER}}                                               & \multicolumn{1}{c}{\textbf{EXISTING SYSTEM}}                                                        & \multicolumn{1}{c}{\textbf{PROPOSED SYSTEM}}                                                          \\ \midrule
\textbf{Type}                                                                        & Content-Based                                                                                       & Service-Based                                                                                         \\
\textbf{User’s Context}                                                              & \begin{tabular}[c]{@{}l@{}}The dialogue does not change \\ according to user’s context\end{tabular} & \begin{tabular}[c]{@{}l@{}}The dialogue changes according \\ to user’s context and needs\end{tabular} \\
\textbf{\begin{tabular}[c]{@{}l@{}}Failure\\ Recovery\end{tabular}}                  & \begin{tabular}[c]{@{}l@{}}User is not notified \\ about the failure\end{tabular}                   & \begin{tabular}[c]{@{}l@{}}The session is maintained, next time\\ when the user calls\end{tabular}    \\
\textbf{\begin{tabular}[c]{@{}l@{}}Number\\ of Dialogues\end{tabular}}               & Fixed                                                                                               & Variable                                                                                              \\
\textbf{\begin{tabular}[c]{@{}l@{}}Use of Domain-Specific\\  Knowledge\end{tabular}} & \begin{tabular}[c]{@{}l@{}}Does\\ not use\end{tabular}                                              & Uses domain-specific knowledge                                                                        \\ \bottomrule
\end{tabular}
\end{table}
\end{document}