# Problem on lines of table

I wanted to create table but the following problem occurred:

The problem is that the lines are not long enough.

Code:

\begin{table}[htp]
\caption{Gross errors found using plausible value check for ambient temperature in Nodes [25-28-29-31-32] }
\label{tab:gr}
\centering
\footnotesize\setlength{\tabcolsep}{2.5pt}
\begin{tabular}{l@{\hspace{6pt}} *{22}{c}}
\toprule
\bfseries Type & \multicolumn{22}{c}{\bfseries Node name} \\
\cmidrule(l){3-23}
& 25 & 28 & 29 & 31 & 32                 \\
\midrule
\bfseries A
& 20276 & 20302 & 20267 & 20263 & 20257    \\
\bfseries B
& 1376 & 1321 & 83 & 1329 & 1502             \\
\bfseries C
& 0 & 0 & 0 & 0 & 0                           \\
\bottomrule
\multicolumn{23}{l}{A: Total number of observations}\\
\multicolumn{23}{l}{B: Number of faults}
\multicolumn{23}{l}{C: Number of faults in 2007-09-29}
\end{tabular}
\end{table}

-
Is there a reason you have 22 columns but do not use all of them? The way that \multicolumn works means that 'unused' columns can cause some odd output: my first guess would be that this may be the issue. –  Joseph Wright Dec 14 '12 at 8:52

It works fine after fixing the errors and adjusting the number of columns.

• Six columns are used (probably the real world case has 23).
• \cmidrule adjusted to 2-6.
• \\ is missing after \multicolumn{...}{l}{B: ...}.
• Using 6 in the \multicolum of the legend.

Full example:

\documentclass{article}
\usepackage{booktabs}

\begin{document}
\begin{table}[htp]
\centering
\caption{Gross errors found using plausible value check for ambient temperature in Nodes [25-28-29-31-32]}
\label{tab:gr}
\footnotesize
\setlength{\tabcolsep}{2.5pt}%
\begin{tabular}{l@{\hspace{6pt}} *{5}{c}}
\toprule
\bfseries Type & \multicolumn{5}{c}{\bfseries Node name} \\
\cmidrule(l){2-6}
& 25 & 28 & 29 & 31 & 32 \\
\midrule
\bfseries A
& 20276 & 20302 & 20267 & 20263 & 20257 \\
\bfseries B
& 1376 & 1321 & 83 & 1329 & 1502 \\
\bfseries C
& 0 & 0 & 0 & 0 & 0 \\
\bottomrule
\multicolumn{6}{l}{A: Total number of observations}\\
\multicolumn{6}{l}{B: Number of faults}\\
\multicolumn{6}{l}{C: Number of faults in 2007-09-29}
\end{tabular}
\end{table}
\end{document}


-
\begin{table}[htp]
\caption{Gross errors found using plausible value check for ambient temperature in Nodes [25-28-29-31-32] }
\label{tab:gr}
\centering
\footnotesize\setlength{\tabcolsep}{2.5pt}
\begin{tabular}{l@{\hspace{6pt}} *{5}{c}}
\toprule
\bfseries Type & \multicolumn{5}{c}{\bfseries Node name} \\
\cmidrule(l){3-5}
& 25 & 28 & 29 & 31 & 32                 \\
\midrule
\bfseries A
& 20276 & 20302 & 20267 & 20263 & 20257    \\
\bfseries B
& 1376 & 1321 & 83 & 1329 & 1502             \\
\bfseries C
& 0 & 0 & 0 & 0 & 0                           \\
\bottomrule
\multicolumn{23}{l}{A: Total number of observations}\\
\multicolumn{23}{l}{B: Number of faults}
\multicolumn{23}{l}{C: Number of faults in 2007-09-29}
\end{tabular}
\end{table}

-
Welcome to TeX.sx! –  lockstep Dec 14 '12 at 9:17
Welcome! Most people don't indent their codes, but I think this is an overindentation example). If you inden't you code you should do it by a reason, in this case, I see a lot of unnecessary indents. –  Manuel Dec 14 '12 at 9:56