1

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 loaded the needed packages, multirow and array:

  \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}

output

6
  • 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. Jan 2, 2013 at 19:03
  • @DavidCarlisle I've just uploaded with the problem with a long word.
    – Isai
    Jan 2, 2013 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. Jan 2, 2013 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, 2013 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, 2013 at 19:33

1 Answer 1

4

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}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .