3

I had attempted to shorten this table and I think I don't think I've edited it properly. In particular I think that I've made a mistake changing everything up to the numeric entries. Would anyone happen to know how I can fix this issue? Apologies for what is likely a simple question.

\begin{table}[hbtp]
\fontsize{6}{6}\selectfont
\caption{First 50 terms of $G(n)$}\label{tab13}
\center{
\begin{tabular}{l r r r r r}
    \hline
    {}&{}&{}&$n$&{}&{}&{}&{}&{}&$n$&{}&{}\\
    \cline{2-6}\cline{8-12}
    {}&1&2&3&4&5\\
    \hline
$V(n+0)$&1&1&1&2&2\\
$V(n+5)$&3&3&4&5&5\\
$V(n+10)$&5&6&6&7&8\\
$V(n+15)$&8&9&9&10&10\\
$V(n+20)$&10&11&11&12&13\\
$V(n+25)$&13&14&14&15&15\\
$V(n+30)$&16&17&17&17&18\\
$V(n+35)$&18&19&19&20&20\\
$V(n+40)$&20&21&21&22&23\\
$V(n+45)$&23&24&24&25&25\\
$V(n+50)$&26&27&27&27&28\\
\hline
\end{tabular}
}
\end{table}
3
  • 1
    What are you trying to do exactly? You've specified six columns, but there are 12 in the first line. Aug 6, 2013 at 15:34
  • Well, I had started with a template that used 10 columns, and now I only need 5 entries. However above where the entries start has not changed to reflect this, I think.
    – user34710
    Aug 6, 2013 at 15:36
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Aug 6, 2013 at 15:37

1 Answer 1

2

I suppose the issue you're referring to is an error saying something like Extra alignment tab has been changed to \cr. This is caused by you using more columns in the tabular than defined in the argument to the environment.

That is, with \begin{tabular}{l r r r r r} you specify six columns, the first one left aligned, the last five right aligned. However, in the first line of the table, you have around 12 columns (i.e. 11 &, column separators), prompting the error.

So all you have to do to fix it is to change

{}&{}&{}&$n$&{}&{}&{}&{}&{}&$n$&{}&{}\\
    \cline{2-6}\cline{8-12}

to

& & & $n$ & & \\
\cline{2-6}

Additional notes:

  • The empty groups ({}) in the empty table cells aren't needed, so I removed them.
  • \center isn't a command that takes an argument, use just \centering, without any braces for what follows.
  • I would use a \baselineskip (second argument of \fontsize) that is a little larger than the fontsize (first argument), for example \fontsize{6}{7}. (Actually, I wouldn't use \fontsize{}{}\selectfont at all, but one of the standard commands for switching font size, listed in What point (pt) font size are \Large etc.?)

Complete code:

\documentclass{article}
\begin{document}

\begin{table}[hbtp]
\fontsize{6}{7}\selectfont
\caption{First 50 terms of $G(n)$}\label{tab13}
\centering
\begin{tabular}{l r r r r r}
    \hline
    & & & $n$ & & \\
    \cline{2-6}
    & 1 & 2 & 3 & 4 & 5 \\
    \hline
$V(n+0)$ & 1 & 1 & 1 & 2 & 2 \\
$V(n+5)$ & 3 & 3 & 4 & 5 & 5 \\
$V(n+10)$ & 5 & 6 & 6 & 7 & 8 \\
$V(n+15)$ & 8 & 9 & 9 & 10 & 10 \\
$V(n+20)$ & 10 & 11 & 11 & 12 & 13\\
$V(n+25)$ & 13 & 14 & 14 & 15 & 15\\
$V(n+30)$ & 16 & 17 & 17 & 17 & 18\\
$V(n+35)$ & 18 & 19 & 19 & 20 & 20\\
$V(n+40)$ & 20 & 21 & 21 & 22 & 23\\
$V(n+45)$ & 23 & 24 & 24 & 25 & 25\\
$V(n+50)$ & 26 & 27 & 27 & 27 & 28\\
\hline
\end{tabular}
\end{table}

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .