0

Sir I am getting this error.

paper.tex 40 Extra alignment tab has been changed to \cr. \endtemplate

l.40 In line no. 40 Nothing is written still it is showing error.

I m also writing the code for table.

\begin{table}[h!]                 
\caption{Delay Comparison of Proposed and Existing Method}                
\begin{center}        
\begin{tabular} {| m{2cm} | m{3cm}| m{3cm} | m{3m} |}    
 \hline    
 Node & OLSR (Proposed Method) & AODV (Existing Method) & DSDV (Existing Method)  
   \tabularnewline    
 \hline    
35  & 801 & 952 &  2457 \tabularnewline    
 \hline    
45  & 522 & 861 &  24621 \tabularnewline    
 \hline    
55  & 391 & 878 &  1277 \tabularnewline        
 \hline    
65  & 290 & 581 &  1144 \tabularnewline    
 \hline    
75  & 338 & 595 &  2103 \tabularnewline    
\hline    
\end{tabular}    
\label{tab1}    
\end{center}\vs{-4mm}    
\end{table}

Please solve my problem.

  • 1
    I can't reproduce the problem you describe. The width of the last column is clearly wrong (3m?!) but with that fixed your example works when pasted into a basic document (with tabularx loaded). You need to provide a complete example (from \documentclass to \end{document} or else it may be impossible to for anyone help further. – Ian Thompson May 25 '18 at 11:50
  • 1
    Please post full MWE for your input, I've changed to \begin{tabular} {| p{2cm} | p{3cm}| p{3cm} | p{3cm} |} then, it's working fine for me – MadyYuvi May 25 '18 at 11:50
3

Your problem come from the width of the last column m{3m} instead of m{3cm}.

However, I think you don't need to use fixed width columns: you can use a standard column type, and use the \thead command from makecell, which allows for a common formatting and line breaks in standard column types. In addition, I propose a second,more professional looking layout, with no vertical rules and the horizontal rules from booktabs, which have variable thickness and add some vertical padding around them:

    \documentclass{article}
    \usepackage{array, booktabs, caption}
    \usepackage{makecell}
    \newcommand*{\nl}{\newline}

    \begin{document}

\begin{table}[h!]
\caption{Delay Comparison of Proposed and Existing Method}
\centering\setlength{\extrarowheight}{2pt}
\begin{tabular} {|>{\centering\arraybackslash}m{2cm} | *{3}{>{\centering\arraybackslash}m{3cm}| }}
 \hline
 Node & OLSR \nl (Proposed Method) & AODV \nl (Existing Method) & DSDV \nl (Existing Method)
 \\
 \hline
65 & 290 & 581 & 1144 \\
 \hline
75 & 338 & 595 & 2103 \\
\hline
\end{tabular}
\label{tab1}
\end{table}

\begin{table}[h!]
\caption{Delay Comparison of Proposed and Existing Method}
\centering
\renewcommand{\theadfont}{\normalsize}
\begin{tabular} {*{4}{c}}
 \toprule
 Node & \thead{OLSR\\ (Proposed\\ Method)} & \thead{AODV \\ (Existing\\ Method)} & \thead{DSDV \\ (Existing\\ Method)}
 \\
 \midrule
65 & 290 & 581 & 1144 \\
 \addlinespace
75 & 338 & 595 & 2103 \\
\bottomrule
\end{tabular}
\label{tab1}
\end{table}

\end{document} 

enter image description here

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.