1

I have the following problem I want to create a table that use a \multicolumn, I want the following

eg 1

but I have this.

eg 1

This is the code that I'm using, Does anyone know how to do this?

\begin{longtable}{| p{5cm} | p{5cm} | p{5cm} |} 
\hline 
Número & Compuesto & Primo \\ 
\hline
124 & X & - \\ 
\hline 
\multicolumn{3}{ p{15cm} }{167149925598414533584400563496249196484626567023954743572719464788289404566848180320469925318728110574074739762450403911375568454294210806669447761437579390493214133578688918826283772069691256544127325402936461605210931966803891178446234431626664000699233882131687123515785136485929356311218831711685861511    }\\
\hline
\end{longtable} 
Torbjørn T.
  • 206,688

1 Answers1

0

The problem is not caused by the table or multicol but simply by the fact that LaTeX doesn't know how to split the extremely long number you gave it. I suggest using the package seqsplit, designed for typesetting DNA sequences.

\usepackage{seqsplit}

...

\begin{longtable}{| p{5cm} | p{5cm} | p{5cm} |} 
\hline 
Número & Compuesto & Primo \\ 
\hline
124 & X & - \\ 
\hline 
\multicolumn{3}{| p{15cm} |}
{\seqsplit{167149925598414533584400563496249196484626567023954743572719464788289404566848180320469925318728110574074739762450403911375568454294210806669447761437579390493214133578688918826283772069691256544127325402936461605210931966803891178446234431626664000699233882131687123515785136485929356311218831711685861511}}\\
\hline
\end{longtable} 

enter image description here

Augustin
  • 5,695