Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have code for creating a table but I came up with a problem:

\documentclass[11pt, a4paper, twoside]{Thesis} % Paper size, default font size and one-sided paper
\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored
\usepackage[square, numbers,rotating, comma, fancyhdr,here,longtable ,sort&compress,caption, booktabs,pifont,epsfig,subfig ,enumitem,array,subcaption, cleveref,subfigure ,tabularx, textcomp, placeins,graphicx, url, blindtext,verbose{placeins}]
\begin{document}

    \begin{table}[htp]
    \caption{The correlation between wireless sensor nodes [25--28--29--31--32] }
        \label{tab: cor}
                \centering
                    \footnotesize\setlength{\tabcolsep}{2.5pt}
                        \begin{tabular}{l@{\hspace{6pt}} *{5}{c}}
                            \toprule
                            \bfseries Node Name & \multicolumn{5}{c}{\bfseries Node name} \\
                            \cmidrule(l){3-5}
                            & 25 & 28 & 29 & 31 & 32                 \\
                            \midrule
                            \bfseries Node 25
                            & 1.00 &    0.96    & 0.92  & 0.97 &    0.97    \\
                            \bfseries Node 28
                            & 0.96& 1.00 &  0.93 &  0.97 &  0.96             \\
                            \bfseries Node 29
                            & 0.92 &    0.93 &  1.00 &  0.92 &  0.94                           \\
                            \bfseries Node 31
                            & 0.97 &    0.97 &  0.92 &  1.00 &  0.96    \\
                            \bfseries Node 32                                      \\
                            & 0.97 &    0.96 &  0.94 &  0.96 &  1.00                  \\
                        \bottomrule
                    \addlinespace
        \end{tabular}
    \end{table}

\end{document}

The problem is highlited where the row doesn't placed in a proper place. enter image description here

share|improve this question
1  
Your code shows "\\" after Node 32. Delete it and everything will go back to its place. –  Ignasi Feb 6 '13 at 9:52
    
@Ignasi, No, it doesn't help –  Hamed Footohi Feb 6 '13 at 9:55
add comment

1 Answer

up vote 3 down vote accepted

After "Node 32", you appear to have an additional new line command \\ that will be causing LaTeX to insert an extra line into your table.

Also, you appear to have a spurious \end command just floating around near the bottom of your code, which caused errors when I attempted to compile.

Minimum working example:

\documentclass[11pt, a4paper, twoside]{article} % Paper size, default font size and one-sided paper
\usepackage{booktabs}
\begin{document}

\begin{table}[htp]
  \caption{The correlation between wireless sensor nodes [25--28--29--31--32] }
  \label{tab: cor}
  \centering
  \footnotesize\setlength{\tabcolsep}{2.5pt}
  \begin{tabular}{l@{\hspace{6pt}} *{5}{c}}
    \toprule
    \bfseries Node Name & \multicolumn{5}{c}{\bfseries Node name} \\
    \cmidrule(l){3-5}
    & 25 & 28 & 29 & 31 & 32\\
    \midrule
    \bfseries Node 25
    & 1.00 &    0.96    & 0.92  & 0.97 &    0.97\\
    \bfseries Node 28
    & 0.96& 1.00 &  0.93 &  0.97 &  0.9\\
    \bfseries Node 29
    & 0.92 &    0.93 &  1.00 &  0.92 &  0.9\\
    \bfseries Node 31
    & 0.97 &    0.97 &  0.92 &  1.00 &  0.96\\
    \bfseries Node 32 
    & 0.97 &    0.96 &  0.94 &  0.96 &  1.00\\
    \bottomrule
    \addlinespace
  \end{tabular}
\end{table}
\end{document}
share|improve this answer
    
Removing "\\" from Node 32 could not help, the same problem exists. –  Hamed Footohi Feb 6 '13 at 10:02
    
I've added a minimum working example which produces the result you requested. –  danbierk Feb 6 '13 at 10:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.