0

Content exceeded limit of the row, when the content is long, my code is

    \usepackage{multirow}
    \begin{document}
        \begin{tabular}{|p{15mm}|c|c|c|c|c|}
\hline
\multirow{2}{=}{hola como estas, yo estoy aprendiendo este mundo bello de la herramienta latex} & \multicolumn{2}{c|}{User B} & %
    \multicolumn{2}{c|}{User C}\\
\cline{2-5}
 & \multicolumn{2}{c|}{Value} & \multicolumn{2}{c|}{Value}  \\

\hline
% etc. ...
\end{tabular}
    \end{document}

the result is: enter image description here

demo: https://es.sharelatex.com/project/5a3056532fa5c507d4467dc1

  • 1
    Please provide an MWE. From what is shown one may suspect that you forgot to load the multirow package. – user121799 Dec 13 '17 at 0:44
  • @marmot I have added the multirow library – x-rw Dec 13 '17 at 0:50
  • 1
    Well, first of all, your document does not start with \documentclass. Second, there are two \end{tabular} commands. Third, even if one makes this code compilable, then there is no 3 appearing. Most importantly, what do you expect LaTeX to do with AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA? What are the hyphenation rules? If you specify them, the A's will no longer overshoot. – user121799 Dec 13 '17 at 0:58
  • @marmot now the content excedeed to down – x-rw Dec 13 '17 at 1:29
  • Well, if you bought a birds cage, would you complain that it doesn't fit a lion? No, you'd either shrink the lion (don't do that! ;-) or buy a bigger cage. Same here. Of course, the content has to fit the environment. You will always be able to create structures that do not fit a given content. – user121799 Dec 13 '17 at 2:26
1

You have to use content which is breakable. With the multirow package you have to make sure that the content fits in the space provided yourself.

\documentclass{article}
\usepackage{multirow}
\begin{document}
    \begin{tabular}{|p{15mm}|c|c|c|c|c|}
    \hline
    \multirow{2}{=}{This is some equally long content with the difference that it is actually breakable} & \multicolumn{2}{c|}{User B} & %
        \multicolumn{2}{c|}{User C}\\
    \cline{2-5}
     & \multicolumn{2}{c|}{Value} & \multicolumn{2}{c|}{Value}  \\

    \hline
    % etc. ...
    \end{tabular}
\end{document}

enter image description here

Otherwise you could use ConTeXt.

\starttext

\startxtable
  \NC[ny=2] This is some equally long content with the difference that it is actually breakable \NC User B \NC User C \NR
                                                                                                \NC Value  \NC Value  \NR
\stopxtable

\stoptext

enter image description here

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.