Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have an issue with the width of a column, I have a long word in a cell which is larger than the column width, I've tried with \parbox, changing the width of the box and the column, but I can't fix it. Here's the code, I wrote the needed packages, multirow and array: (I'm sorry for the rotated image).

  \documentclass{article}
   \usepackage{array}
   \usepackage{multirow}
   \begin{document}
   \begin{table}[H]
 \centering
 \begin{tabular}{|c|>{\centering\arraybackslash}m{13mm}|>     {\centering\arraybackslash}m{13mm}|>{\centering\arraybackslash}m{13mm}|>          {\centering\arraybackslash}m{13mm}|>{\centering\arraybackslash}m{13mm}|>{\centering\arraybackslash}m{30mm}|}
 \hline
 \multirow{2}{*}{text} & \multicolumn{4}{|c|}{text text text text text text text} & \multirow{2}{*}{thereisalongwordhere}\\
 \cline{2-5}
 & text & text & text & text &\\
 \hline
 \end{tabular}
 \end{table}
 \end{document}

enter image description here

share|improve this question
    
Please always post complete documents it makes modifying the code much easier. It isn't clear what result you want here, for example does the last column have to be m or can it simply be c and fill to its natural width the same as the * specifier for multirow. –  David Carlisle Jan 2 '13 at 19:03
    
@DavidCarlisle I've just uploaded with the problem with a long word. –  Isai Jan 2 '13 at 19:08
    
You added an image but that's what I saw when I ran it locally, that's why I asked in the comment what you want to do, just simply changing the last column to c would make it wider, but perhaps you need it to be an m column for other reasons not shown in this example. –  David Carlisle Jan 2 '13 at 19:10
    
@DavidCarlisle I appreciate your answer, but changing for 'c', I can't fix it. On the other hand, only with the code of the heading of my table, exists the issue. –  Isai Jan 2 '13 at 19:17
    
Can you please post a complete MWE? I have trouble guessing which one of the many tabular extension packages you are using. –  Max Jan 2 '13 at 19:33
show 1 more comment

1 Answer

up vote 3 down vote accepted

Your main problem is that you had more column specifiers than columns so the last column specifier was never used.

enter image description here

Note this is a complete document.

\documentclass[a4paper]{article}  
\usepackage{array,multirow}
\begin{document}

 \begin{tabular}{
|c|
>{\centering\arraybackslash}m{13mm}|
>{\centering\arraybackslash}m{13mm}|
>{\centering\arraybackslash}m{13mm}|
>{\centering\arraybackslash}m{13mm}|
>{\centering\arraybackslash}m{33mm}|
}
 \hline
 \multirow{2}{*}{text} & \multicolumn{4}{|c|}{text text text text text text text} & \multirow{2}{*}{thereisalongwordhere}\\
 \cline{2-5}
 & text & text & text & text &\\
 \hline
 \end{tabular}


\bigskip


 \begin{tabular}{%
|c|
>{\centering\arraybackslash}m{13mm}|
>{\centering\arraybackslash}m{13mm}|
>{\centering\arraybackslash}m{13mm}|
>{\centering\arraybackslash}m{13mm}|
c|}
 \hline
 \multirow{2}{*}{text} & \multicolumn{4}{|c|}{text text text text text text text} & \multirow{2}{*}{thereisalongwordhere}\\
 \cline{2-5}
 & text & text & text & text &\\
 \hline
 \end{tabular}

\end{document}
share|improve this answer
    
You're right, I get it, thank you so much. –  Isai Jan 2 '13 at 19:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.