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

information
  • 1,075
  • 1
    Please provide an MWE. From what is shown one may suspect that you forgot to load the multirow package. –  Dec 13 '17 at 00:44
  • @marmot I have added the multirow library – information Dec 13 '17 at 00: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. –  Dec 13 '17 at 00:58
  • @marmot now the content excedeed to down – information Dec 13 '17 at 01: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. –  Dec 13 '17 at 02:26

1 Answers1

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

Henri Menke
  • 109,596