1
\begin{table}[ht]
            \begin{tabular}{*{32}{|c|}}
            \hline
            \multicolumn{1}{|c|}{1}
            \multicolumn{9}{|c|}{2}
            \multicolumn{23}{|c|}{3}
            \\
            \hline
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \multicolumn{1}{|c|}{0}
            \end{tabular}
        \end{table}

I want it to be such that the number 1 will be above the first zero, the number 2 will be as long as 9 zero's and the 3 as long as 23 zero's but it does not work, the multicolumn not work.

  • 1
    Look at the first row. If you summarise the multicolumns, you get 33, one more than the number of defined columns. The next row has only 9 cells, 23 less than defined. You have also forgotten the cell separator & – Sveinung Nov 12 '19 at 13:11
0

You have several syntax erros in you example, in addition to it is not an MWE.

  1. Look at the first row. If you summarise the multicolumns, you get 33, one cell more than the number of columns you have defined.

  2. The next row has only 9 cells, 23 less than defined.

  3. You have also forgotten the cell separator &

  4. You have misplaced the |

  5. You use \multicolumns where it is not necessary.

I suggest that you read a basic introduction to typesetting tables.

This example works as expected, I hope:

enter image description here

\documentclass[landscape]{article}
\usepackage[table]{xcolor}

\begin{document}

\begin{table}[ht]
            \begin{tabular}{|*{32}{c|}}
            \hline
            1&
            \multicolumn{9}{c|}{2}&
            \multicolumn{22}{c|}{3}
            \\
            \hline
             0&0&0&0&0&0&0&0&0&0&0&
             0&0&0&0&0&0&0&0&0&0&0&
             0&0&0&0&0&0&0&0&0&0

            \end{tabular}
        \end{table}

\end{document}
| improve this answer | |

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.